[cmake-commits] hoffman committed cmLocalVisualStudio7Generator.cxx
1.152 1.153
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Oct 13 16:13:18 EDT 2006
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv15597
Modified Files:
cmLocalVisualStudio7Generator.cxx
Log Message:
BUG: fix for bug#3908 if header_file_only is set on cxx files in visual studio do not compile them
Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- cmLocalVisualStudio7Generator.cxx 4 Oct 2006 18:02:12 -0000 1.152
+++ cmLocalVisualStudio7Generator.cxx 13 Oct 2006 20:13:14 -0000 1.153
@@ -1148,7 +1148,6 @@
{
objectName = "";
}
-
// Add per-source flags.
const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS");
if(cflags)
@@ -1161,6 +1160,12 @@
const char* linkLanguage = target.GetLinkerLanguage
(this->GetGlobalGenerator());
+ // If lang is set, the compiler will generate code automatically.
+ // If HEADER_FILE_ONLY is set, we must suppress this generation in
+ // the project file
+ bool excludedFromBuild =
+ (lang && (*sf)->GetPropertyAsBool("HEADER_FILE_ONLY"));
+
// if the source file does not match the linker language
// then force c or c++
if(linkLanguage && lang && strcmp(lang, linkLanguage) != 0)
@@ -1216,7 +1221,7 @@
command->GetOutputs(), flags);
}
else if(compileFlags.size() || additionalDeps.length()
- || objectName.size())
+ || objectName.size() || excludedFromBuild)
{
const char* aCompilerTool = "VCCLCompilerTool";
std::string ext = (*sf)->GetSourceExtension();
@@ -1238,8 +1243,13 @@
{
fout << "\t\t\t\t<FileConfiguration\n"
<< "\t\t\t\t\tName=\"" << *i
- << "|" << this->PlatformName << "\">\n"
- << "\t\t\t\t\t<Tool\n"
+ << "|" << this->PlatformName << "\"";
+ if(excludedFromBuild)
+ {
+ fout << " ExcludedFromBuild=\"true\"";
+ }
+ fout << ">\n";
+ fout << "\t\t\t\t\t<Tool\n"
<< "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n";
if(compileFlags.size())
{
More information about the Cmake-commits
mailing list