diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-10-13 20:13:14 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-10-13 20:13:14 (GMT) |
commit | 655ba54e2d74f50441829001995a4e1ce1a1ae88 (patch) | |
tree | 9f211dd6706c1e0130fdfb452f7b656e9d2ce88f /Source | |
parent | bf74cd9d832c065c348142fc6132859e7da6396b (diff) | |
download | CMake-655ba54e2d74f50441829001995a4e1ce1a1ae88.zip CMake-655ba54e2d74f50441829001995a4e1ce1a1ae88.tar.gz CMake-655ba54e2d74f50441829001995a4e1ce1a1ae88.tar.bz2 |
BUG: fix for bug#3908 if header_file_only is set on cxx files in visual studio do not compile them
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 94ff58c..0fbca35 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1148,7 +1148,6 @@ void cmLocalVisualStudio7Generator { objectName = ""; } - // Add per-source flags. const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS"); if(cflags) @@ -1161,6 +1160,12 @@ void cmLocalVisualStudio7Generator 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 @@ void cmLocalVisualStudio7Generator 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 @@ void cmLocalVisualStudio7Generator { 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()) { |