summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-05 15:50:10 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-09 14:59:57 (GMT)
commit8f4bdcc6cbc9dd3b146d4d51abf2f3b57bb6bbc8 (patch)
tree978a38cd821fb43f0ea7c5b5b37c1ceca9e6b57e
parenteaa9f2f8eeaacb8df762efa5f7f95820aac06729 (diff)
downloadCMake-8f4bdcc6cbc9dd3b146d4d51abf2f3b57bb6bbc8.zip
CMake-8f4bdcc6cbc9dd3b146d4d51abf2f3b57bb6bbc8.tar.gz
CMake-8f4bdcc6cbc9dd3b146d4d51abf2f3b57bb6bbc8.tar.bz2
VS: Remove always-true condition on compile options block
The cmVisualStudio10TargetGenerator::ComputeClOptions method is only called when the target type compiles, so do not duplicate that check in the implementation.
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx68
1 files changed, 32 insertions, 36 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 453e983..7b30e42 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1367,44 +1367,40 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
Options& clOptions = *pOptions;
std::string flags;
- // collect up flags for
- if(this->Target->GetType() < cmTarget::UTILITY)
+ const std::string& linkLanguage =
+ this->Target->GetLinkerLanguage(configName.c_str());
+ if(linkLanguage.empty())
{
- const std::string& linkLanguage =
- this->Target->GetLinkerLanguage(configName.c_str());
- if(linkLanguage.empty())
- {
- cmSystemTools::Error
- ("CMake can not determine linker language for target: ",
- this->Name.c_str());
- return false;
- }
- if(linkLanguage == "C" || linkLanguage == "CXX"
- || linkLanguage == "Fortran")
- {
- std::string baseFlagVar = "CMAKE_";
- baseFlagVar += linkLanguage;
- baseFlagVar += "_FLAGS";
- flags = this->
- Target->GetMakefile()->GetRequiredDefinition(baseFlagVar.c_str());
- std::string flagVar = baseFlagVar + std::string("_") +
- cmSystemTools::UpperCase(configName);
- flags += " ";
- flags += this->
- Target->GetMakefile()->GetRequiredDefinition(flagVar.c_str());
- }
- // set the correct language
- if(linkLanguage == "C")
- {
- flags += " /TC ";
- }
- if(linkLanguage == "CXX")
- {
- flags += " /TP ";
- }
- this->LocalGenerator->AddCompileOptions(flags, this->Target,
- linkLanguage, configName.c_str());
+ cmSystemTools::Error
+ ("CMake can not determine linker language for target: ",
+ this->Name.c_str());
+ return false;
+ }
+ if(linkLanguage == "C" || linkLanguage == "CXX"
+ || linkLanguage == "Fortran")
+ {
+ std::string baseFlagVar = "CMAKE_";
+ baseFlagVar += linkLanguage;
+ baseFlagVar += "_FLAGS";
+ flags = this->
+ Target->GetMakefile()->GetRequiredDefinition(baseFlagVar.c_str());
+ std::string flagVar = baseFlagVar + std::string("_") +
+ cmSystemTools::UpperCase(configName);
+ flags += " ";
+ flags += this->
+ Target->GetMakefile()->GetRequiredDefinition(flagVar.c_str());
+ }
+ // set the correct language
+ if(linkLanguage == "C")
+ {
+ flags += " /TC ";
+ }
+ if(linkLanguage == "CXX")
+ {
+ flags += " /TP ";
}
+ this->LocalGenerator->AddCompileOptions(flags, this->Target,
+ linkLanguage, configName.c_str());
// Get preprocessor definitions for this directory.
std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags();