summaryrefslogtreecommitdiff
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-04-11 10:39:04 -0400
committerBrad King <brad.king@kitware.com>2016-04-11 10:39:04 -0400
commit82ef90fcfccb1eaf53e4d15884ff3464aa9072a3 (patch)
tree3ba3757b275687a13c5bbb787dff14c6060d2907 /Source/cmCoreTryCompile.cxx
parent9ac11bc25d6b9f5e7db786034f922d96613e6143 (diff)
downloadcmake-82ef90fcfccb1eaf53e4d15884ff3464aa9072a3.tar.gz
cmCoreTryCompile: Factor out config lookup for re-use
Store the lookup of CMAKE_TRY_COMPILE_CONFIGURATION in a local variable so we can re-use it.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index b639c15a18..bf89dcb096 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -294,6 +294,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
}
+ std::string const tcConfig =
+ this->Makefile->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
+
// we need to create a directory and CMakeLists file etc...
// first create the directories
sourceDirectory = this->BinaryDirectory.c_str();
@@ -406,8 +409,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
std::string fname = "/" + std::string(targetName) + "Targets.cmake";
cmExportTryCompileFileGenerator tcfg(gg, targets, this->Makefile);
tcfg.SetExportFile((this->BinaryDirectory + fname).c_str());
- tcfg.SetConfig(this->Makefile->GetSafeDefinition(
- "CMAKE_TRY_COMPILE_CONFIGURATION"));
+ tcfg.SetConfig(tcConfig);
if(!tcfg.GenerateImportFile())
{