diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-09-21 06:51:42 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2012-09-21 11:28:53 (GMT) |
commit | 0ff4e3f0b88885eafab0693fdf03b44c7a5f9d0c (patch) | |
tree | 86d6d179c804feeaa3bcfcc188400a7b09bc0e0e /Source | |
parent | f178d531a6a75b3cbdaa0a3dec5e0aa8daca7d24 (diff) | |
download | CMake-0ff4e3f0b88885eafab0693fdf03b44c7a5f9d0c.zip CMake-0ff4e3f0b88885eafab0693fdf03b44c7a5f9d0c.tar.gz CMake-0ff4e3f0b88885eafab0693fdf03b44c7a5f9d0c.tar.bz2 |
Port remaining code to GetCompileDefinitions().
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 16 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 15 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 12 |
4 files changed, 18 insertions, 36 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 7953dd9..8b2daba 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -617,14 +617,17 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, " <Option compiler=\"" << compiler << "\" />\n" " <Compiler>\n"; + cmGeneratorTarget *gtgt = this->GlobalGenerator + ->GetGeneratorTarget(target); + // the compilerdefines for this target - const char* cdefs = target->GetMakefile()->GetProperty( - "COMPILE_DEFINITIONS"); - if(cdefs) + std::string cdefs = gtgt->GetCompileDefinitions(); + + if(cdefs.empty()) { // Expand the list. std::vector<std::string> defs; - cmSystemTools::ExpandListArgument(cdefs, defs); + cmSystemTools::ExpandListArgument(cdefs.c_str(), defs); for(std::vector<std::string>::const_iterator di = defs.begin(); di != defs.end(); ++di) { diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f9a1503..a270cc9 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1647,16 +1647,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // Add the export symbol definition for shared library objects. this->AppendDefines(ppDefs, exportMacro); } - this->AppendDefines - (ppDefs, this->CurrentMakefile->GetProperty("COMPILE_DEFINITIONS")); - this->AppendDefines(ppDefs, target.GetProperty("COMPILE_DEFINITIONS")); + cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target); + this->AppendDefines(ppDefs, gtgt->GetCompileDefinitions()); if(configName) { - std::string defVarName = "COMPILE_DEFINITIONS_"; - defVarName += cmSystemTools::UpperCase(configName); - this->AppendDefines - (ppDefs, this->CurrentMakefile->GetProperty(defVarName.c_str())); - this->AppendDefines(ppDefs, target.GetProperty(defVarName.c_str())); + this->AppendDefines(ppDefs, gtgt->GetCompileDefinitions(configName)); } buildSettings->AddAttribute ("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList()); @@ -1713,10 +1708,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // Set target-specific architectures. std::vector<std::string> archs; - { - cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target); gtgt->GetAppleArchs(configName, archs); - } + if(!archs.empty()) { // Enable ARCHS attribute. @@ -1953,7 +1946,6 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, BuildObjectListOrString dirs(this, this->XcodeVersion >= 30); BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30); std::vector<std::string> includes; - cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target); this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt); std::set<cmStdString> emitted; emitted.insert("/System/Library/Frameworks"); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 2ededfe..71c1647 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -724,10 +724,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, flags += targetFlags; } - std::string configUpper = cmSystemTools::UpperCase(configName); - std::string defPropName = "COMPILE_DEFINITIONS_"; - defPropName += configUpper; - // Get preprocessor definitions for this directory. std::string defineFlags = this->Makefile->GetDefineFlags(); Options::Tool t = Options::Compiler; @@ -744,11 +740,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, targetOptions.Parse(flags.c_str()); targetOptions.Parse(defineFlags.c_str()); targetOptions.ParseFinish(); - targetOptions.AddDefines - (this->Makefile->GetProperty("COMPILE_DEFINITIONS")); - targetOptions.AddDefines(target.GetProperty("COMPILE_DEFINITIONS")); - targetOptions.AddDefines(this->Makefile->GetProperty(defPropName.c_str())); - targetOptions.AddDefines(target.GetProperty(defPropName.c_str())); + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(&target); + targetOptions.AddDefines(gt->GetCompileDefinitions()); + targetOptions.AddDefines(gt->GetCompileDefinitions(configName)); targetOptions.SetVerboseMakefile( this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")); @@ -819,8 +814,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); fout << "\t\t\t\tAdditionalIncludeDirectories=\""; std::vector<std::string> includes; - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(&target); this->GetIncludeDirectories(includes, gt); std::vector<std::string>::iterator i = includes.begin(); for(;i != includes.end(); ++i) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index fea117a..87312ae 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1225,21 +1225,15 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( flags += " "; flags += targetFlags; } - std::string configUpper = cmSystemTools::UpperCase(configName); - std::string defPropName = "COMPILE_DEFINITIONS_"; - defPropName += configUpper; - // Get preprocessor definitions for this directory. std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags(); clOptions.FixExceptionHandlingDefault(); clOptions.AddFlag("PrecompiledHeader", "NotUsing"); clOptions.Parse(flags.c_str()); clOptions.Parse(defineFlags.c_str()); - clOptions.AddDefines - (this->Makefile->GetProperty("COMPILE_DEFINITIONS")); - clOptions.AddDefines(this->Target->GetProperty("COMPILE_DEFINITIONS")); - clOptions.AddDefines(this->Makefile->GetProperty(defPropName.c_str())); - clOptions.AddDefines(this->Target->GetProperty(defPropName.c_str())); + clOptions.AddDefines(this->GeneratorTarget->GetCompileDefinitions()); + clOptions.AddDefines(this->GeneratorTarget->GetCompileDefinitions( + configName.c_str())); clOptions.SetVerboseMakefile( this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")); |