summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-29 12:56:43 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-29 12:56:45 (GMT)
commit7b7c9f7c206254a27063c65067529730cb149d80 (patch)
treebc4d9948e8e85e362addc438cf31ff997432172d /Source
parent59285ee58ea2a02b53ca1e429ded198ee2c2fd21 (diff)
parent298493769fe39ba57bdf766c437f1201d0fe5c9c (diff)
downloadCMake-7b7c9f7c206254a27063c65067529730cb149d80.zip
CMake-7b7c9f7c206254a27063c65067529730cb149d80.tar.gz
CMake-7b7c9f7c206254a27063c65067529730cb149d80.tar.bz2
Merge topic 'simplify-generator-parameters'
29849376 try_compile: Simplify generator platform and toolset propagation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1318
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx4
-rw-r--r--Source/cmake.cxx9
-rw-r--r--Source/cmake.h12
3 files changed, 5 insertions, 20 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 32181cf..5643c97 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3186,8 +3186,8 @@ int cmMakefile::TryCompile(const std::string& srcdir,
// do a configure
cm.SetHomeDirectory(srcdir);
cm.SetHomeOutputDirectory(bindir);
- cm.SetGeneratorPlatform(this->GetCMakeInstance()->GetGeneratorPlatform());
- cm.SetGeneratorToolset(this->GetCMakeInstance()->GetGeneratorToolset());
+ cm.SetGeneratorPlatform(this->GetSafeDefinition("CMAKE_GENERATOR_PLATFORM"));
+ cm.SetGeneratorToolset(this->GetSafeDefinition("CMAKE_GENERATOR_TOOLSET"));
cm.LoadCache();
if (!gg->IsMultiConfig()) {
if (const char* config =
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 61595d5..fd7151f 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1328,9 +1328,8 @@ int cmake::ActualConfigure()
if (const char* platformName =
this->State->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) {
- if (this->GeneratorPlatform.empty()) {
- this->GeneratorPlatform = platformName;
- } else if (this->GeneratorPlatform != platformName) {
+ if (!this->GeneratorPlatform.empty() &&
+ this->GeneratorPlatform != platformName) {
std::string message = "Error: generator platform: ";
message += this->GeneratorPlatform;
message += "\nDoes not match the platform used previously: ";
@@ -1348,9 +1347,7 @@ int cmake::ActualConfigure()
if (const char* tsName =
this->State->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) {
- if (this->GeneratorToolset.empty()) {
- this->GeneratorToolset = tsName;
- } else if (this->GeneratorToolset != tsName) {
+ if (!this->GeneratorToolset.empty() && this->GeneratorToolset != tsName) {
std::string message = "Error: generator toolset: ";
message += this->GeneratorToolset;
message += "\nDoes not match the toolset used previously: ";
diff --git a/Source/cmake.h b/Source/cmake.h
index a2054ef..b31b6f5 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -209,24 +209,12 @@ public:
this->GeneratorPlatform = ts;
}
- ///! Get the name of the selected generator-specific platform.
- std::string const& GetGeneratorPlatform() const
- {
- return this->GeneratorPlatform;
- }
-
///! Set the name of the selected generator-specific toolset.
void SetGeneratorToolset(std::string const& ts)
{
this->GeneratorToolset = ts;
}
- ///! Get the name of the selected generator-specific toolset.
- std::string const& GetGeneratorToolset() const
- {
- return this->GeneratorToolset;
- }
-
const std::vector<std::string>& GetSourceExtensions() const
{
return this->SourceFileExtensions;