summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-08-24 18:24:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-08-24 18:24:24 (GMT)
commit05784dadc59ee3c87ab6140d684ff4c602de9ec1 (patch)
treedbaac2b00fb70a112a9e1ee71323c5c224bde6b9 /Source/cmNinjaTargetGenerator.cxx
parent286f7c9644d1fb8ac8b5d46e2a3c9c393680acef (diff)
parentf0a1065393a57f503bc2c86f432f50dd4b8d5bbd (diff)
downloadCMake-05784dadc59ee3c87ab6140d684ff4c602de9ec1.zip
CMake-05784dadc59ee3c87ab6140d684ff4c602de9ec1.tar.gz
CMake-05784dadc59ee3c87ab6140d684ff4c602de9ec1.tar.bz2
Merge topic 'compile-definitions-unique'
f0a1065 Rename files from main.cpp to more meaningful names. ca7fb14 Fix the test setting COMPILE_DEFINITIONS target property 733deb6 Fix CompileDefinitions test on Visual Studio. 3dae652 Don't duplicate -D defines sent to the compiler.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx29
1 files changed, 13 insertions, 16 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index b6bdfdc..641516e 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