From b94530c7b40646be20c1d6f7cd4c1a5cd450b0d7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 20 Nov 2007 11:18:04 -0500 Subject: [PATCH] BUG: Need to honor HEADER_FILE_ONLY source file property and exclude the source from the build. --- Source/cmLocalVisualStudio6Generator.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 59bf35e99..dda7e6012 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -427,6 +427,9 @@ void cmLocalVisualStudio6Generator compileFlags += " /TC "; } } + + bool excludedFromBuild = + (lang && (*sf)->GetPropertyAsBool("HEADER_FILE_ONLY")); // Check for extra object-file dependencies. const char* dependsValue = (*sf)->GetProperty("OBJECT_DEPENDS"); @@ -460,7 +463,8 @@ void cmLocalVisualStudio6Generator const char* flags = compileFlags.size() ? compileFlags.c_str(): 0; this->WriteCustomRule(fout, source.c_str(), *command, flags); } - else if(!compileFlags.empty() || !objectNameDir.empty()) + else if(!compileFlags.empty() || !objectNameDir.empty() || + excludedFromBuild) { for(std::vector::iterator i = this->Configurations.begin(); @@ -474,6 +478,10 @@ void cmLocalVisualStudio6Generator { fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl; } + if(excludedFromBuild) + { + fout << "# PROP Exclude_From_Build 1\n"; + } if(!compileFlags.empty()) { fout << "\n# ADD CPP " << compileFlags << "\n\n";