diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-08-09 07:44:15 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2012-08-20 20:30:11 (GMT) |
commit | 3dae652b4ea8e039dd9f4d845497ec988fbbe82c (patch) | |
tree | 22241a616f674ac6fe82375690e8485d19e32725 /Source/cmNinjaTargetGenerator.cxx | |
parent | d46f8afae98cd8f50cff9915a5a9dc680b9e0518 (diff) | |
download | CMake-3dae652b4ea8e039dd9f4d845497ec988fbbe82c.zip CMake-3dae652b4ea8e039dd9f4d845497ec988fbbe82c.tar.gz CMake-3dae652b4ea8e039dd9f4d845497ec988fbbe82c.tar.bz2 |
Don't duplicate -D defines sent to the compiler.
There is no need to do so. Be consistent with include directories and
ensure uniqueness.
This requires changing the API of the cmLocalGenerator::AppendDefines
method, and changing the generators to match.
The test unfortunately can't test for uniqueness, but it at least verifies
that nothing gets lost.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 3532c8b..185965c 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -184,46 +184,43 @@ std::string cmNinjaTargetGenerator:: ComputeDefines(cmSourceFile *source, const std::string& language) { - std::string defines; + std::set<std::string> defines; // Add the export symbol definition for shared library objects. if(const char* exportMacro = this->Target->GetExportMacro()) { - this->LocalGenerator->AppendDefines(defines, exportMacro, - language.c_str()); + this->LocalGenerator->AppendDefines(defines, exportMacro); } // Add preprocessor definitions for this target and configuration. this->LocalGenerator->AppendDefines (defines, - this->Makefile->GetProperty("COMPILE_DEFINITIONS"), - language.c_str()); + this->Makefile->GetProperty("COMPILE_DEFINITIONS")); this->LocalGenerator->AppendDefines (defines, - this->Target->GetProperty("COMPILE_DEFINITIONS"), - language.c_str()); + this->Target->GetProperty("COMPILE_DEFINITIONS")); this->LocalGenerator->AppendDefines (defines, - source->GetProperty("COMPILE_DEFINITIONS"), - language.c_str()); + source->GetProperty("COMPILE_DEFINITIONS")); { std::string defPropName = "COMPILE_DEFINITIONS_"; defPropName += cmSystemTools::UpperCase(this->GetConfigName()); this->LocalGenerator->AppendDefines (defines, - this->Makefile->GetProperty(defPropName.c_str()), - language.c_str()); + this->Makefile->GetProperty(defPropName.c_str())); this->LocalGenerator->AppendDefines (defines, - this->Target->GetProperty(defPropName.c_str()), - language.c_str()); + this->Target->GetProperty(defPropName.c_str())); this->LocalGenerator->AppendDefines (defines, - source->GetProperty(defPropName.c_str()), - language.c_str()); + source->GetProperty(defPropName.c_str())); } - return defines; + std::string definesString; + this->LocalGenerator->JoinDefines(defines, definesString, + language.c_str()); + + return definesString; } cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const |