summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-17 19:05:17 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-17 20:01:41 (GMT)
commitecb34faaaba841aac6dae722dd2c6256a1472d74 (patch)
tree66b645543db90f50dad5e4dda31efdc9565694ed /Source/cmGlobalGenerator.cxx
parente4510941a3cc5f2990d79242db791bf370bb07d3 (diff)
downloadCMake-ecb34faaaba841aac6dae722dd2c6256a1472d74.zip
CMake-ecb34faaaba841aac6dae722dd2c6256a1472d74.tar.gz
CMake-ecb34faaaba841aac6dae722dd2c6256a1472d74.tar.bz2
Tell generators about CMAKE_SYSTEM_NAME as soon as it is known
Add a cmGlobalGenerator::SetSystemName virtual method. Call it from cmGlobalGenerator::EnableLanguage as soon as CMAKE_SYSTEM_NAME is known. This will give generators a chance to adapt themselves to the target system. Pass the cmMakefile instance to the method so that the generator can update it accordingly. Return early from EnableLanguage if SetSystemName returns false.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 36932aa..6d737b1 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -448,6 +448,14 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
mf->ReadListFile(0,fpath.c_str());
}
+ // Tell the generator about the target system.
+ std::string system = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
+ if(!this->SetSystemName(system, mf))
+ {
+ cmSystemTools::SetFatalErrorOccured();
+ return;
+ }
+
// Tell the generator about the toolset, if any.
std::string toolset = mf->GetSafeDefinition("CMAKE_GENERATOR_TOOLSET");
if(!toolset.empty() &&