BUG: Need to honor HEADER_FILE_ONLY source file property and exclude the source from the build.

This commit is contained in:
Brad King 2007-11-20 11:18:04 -05:00
parent eee575283d
commit b94530c7b4
1 changed files with 9 additions and 1 deletions

View File

@ -427,6 +427,9 @@ void cmLocalVisualStudio6Generator
compileFlags += " /TC "; compileFlags += " /TC ";
} }
} }
bool excludedFromBuild =
(lang && (*sf)->GetPropertyAsBool("HEADER_FILE_ONLY"));
// Check for extra object-file dependencies. // Check for extra object-file dependencies.
const char* dependsValue = (*sf)->GetProperty("OBJECT_DEPENDS"); const char* dependsValue = (*sf)->GetProperty("OBJECT_DEPENDS");
@ -460,7 +463,8 @@ void cmLocalVisualStudio6Generator
const char* flags = compileFlags.size() ? compileFlags.c_str(): 0; const char* flags = compileFlags.size() ? compileFlags.c_str(): 0;
this->WriteCustomRule(fout, source.c_str(), *command, flags); this->WriteCustomRule(fout, source.c_str(), *command, flags);
} }
else if(!compileFlags.empty() || !objectNameDir.empty()) else if(!compileFlags.empty() || !objectNameDir.empty() ||
excludedFromBuild)
{ {
for(std::vector<std::string>::iterator i for(std::vector<std::string>::iterator i
= this->Configurations.begin(); = this->Configurations.begin();
@ -474,6 +478,10 @@ void cmLocalVisualStudio6Generator
{ {
fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl; fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl;
} }
if(excludedFromBuild)
{
fout << "# PROP Exclude_From_Build 1\n";
}
if(!compileFlags.empty()) if(!compileFlags.empty())
{ {
fout << "\n# ADD CPP " << compileFlags << "\n\n"; fout << "\n# ADD CPP " << compileFlags << "\n\n";