summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-06-26 13:01:57 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-06-26 13:01:57 (GMT)
commit1c517989405d7a25e669a25fd20f97fb112d279e (patch)
tree9e0ac96f0e0938bae072434ad14d9827f05629f2 /Source
parentfdd558d6a6d630d4b0b1f6e84875b3f98fbc0e67 (diff)
parent2d9ec1dadfdd10043a98d425abb25d0aef117699 (diff)
downloadCMake-1c517989405d7a25e669a25fd20f97fb112d279e.zip
CMake-1c517989405d7a25e669a25fd20f97fb112d279e.tar.gz
CMake-1c517989405d7a25e669a25fd20f97fb112d279e.tar.bz2
Merge topic 'COMPILER_TARGET'
2d9ec1d Add compiler target compile options.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f943161..684c3c4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1044,11 +1044,20 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
// If this is the compiler then look for the extra variable
// _COMPILER_ARG1 which must be the first argument to the compiler
const char* compilerArg1 = 0;
+ const char* compilerTarget = 0;
+ const char* compilerOptionTarget = 0;
if(actualReplace == "CMAKE_${LANG}_COMPILER")
{
std::string arg1 = actualReplace + "_ARG1";
cmSystemTools::ReplaceString(arg1, "${LANG}", lang);
compilerArg1 = this->Makefile->GetDefinition(arg1.c_str());
+ compilerTarget
+ = this->Makefile->GetDefinition(
+ (std::string("CMAKE_") + lang + "_COMPILER_TARGET").c_str());
+ compilerOptionTarget
+ = this->Makefile->GetDefinition(
+ (std::string("CMAKE_") + lang +
+ "_COMPILE_OPTION_TARGET").c_str());
}
if(actualReplace.find("${LANG}") != actualReplace.npos)
{
@@ -1069,6 +1078,11 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
ret += " ";
ret += compilerArg1;
}
+ if (compilerTarget && compilerOptionTarget)
+ {
+ ret += compilerOptionTarget;
+ ret += compilerTarget;
+ }
return ret;
}
return replace;