diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index f0ce049d0..52981f3cd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -567,7 +567,7 @@ void cmVisualStudio10TargetGenerator::WriteCLSources() || this->GlobalGenerator->IgnoreFile ((*source)->GetExtension().c_str()); const char* lang = (*source)->GetLanguage(); - if(header || lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0)) + bool cl = lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0); { std::string sourceFile = (*source)->GetFullPath(); sourceFile = cmSystemTools::RelativePath( @@ -579,13 +579,17 @@ void cmVisualStudio10TargetGenerator::WriteCLSources() { this->WriteString("WriteString("WriteString("BuildFileStream ) << sourceFile << "\""; // ouput any flags specific to this source file - if(this->OutputSourceSpecificFlags(*source)) + if(cl && this->OutputSourceSpecificFlags(*source)) { // if the source file has specific flags the tag // is ended on a new line