diff options
author | Brad King <brad.king@kitware.com> | 2014-07-17 20:34:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-17 20:34:21 (GMT) |
commit | 6e176e6d9efa80fb4d08f1ead6bc33f115f8885d (patch) | |
tree | a21e174293423fa20a15ee6e2d37703003e94379 | |
parent | d3d9218a52dad04c1cfa87e537d98ee0678db1db (diff) | |
download | CMake-6e176e6d9efa80fb4d08f1ead6bc33f115f8885d.zip CMake-6e176e6d9efa80fb4d08f1ead6bc33f115f8885d.tar.gz CMake-6e176e6d9efa80fb4d08f1ead6bc33f115f8885d.tar.bz2 |
VS: Delay platform definitions until system name is known
Move the definition of CMAKE_VS_PLATFORM_NAME and other variables that
are not needed by CMakeDetermineSystem out of the AddPlatformDefinitions
method and into a SetSystemName method. The latter may later use
CMAKE_SYSTEM_NAME to decide what platform-specific definitions to add.
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 5 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 5 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 11 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 2 |
6 files changed, 19 insertions, 9 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 80d08b9..03b2b2f 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -125,10 +125,11 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts, } //---------------------------------------------------------------------------- -void cmGlobalVisualStudio10Generator::AddPlatformDefinitions(cmMakefile* mf) +bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s, + cmMakefile* mf) { - cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf); this->AddVSPlatformToolsetDefinition(mf); + return this->cmGlobalVisualStudio8Generator::SetSystemName(s, mf); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 107b646..cb639dd 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -31,6 +31,7 @@ public: virtual bool MatchesGeneratorName(const std::string& name) const; virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf); + virtual bool SetSystemName(std::string const& s, cmMakefile* mf); virtual void GenerateBuildCommand( std::vector<std::string>& makeCommand, @@ -43,8 +44,6 @@ public: std::vector<std::string> const& makeOptions = std::vector<std::string>() ); - virtual void AddPlatformDefinitions(cmMakefile* mf); - ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 759e81e..602d678 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -80,7 +80,6 @@ void cmGlobalVisualStudio7Generator { mf->AddDefinition("CMAKE_GENERATOR_RC", "rc"); mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); - this->AddPlatformDefinitions(mf); if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) { mf->AddCacheDefinition( @@ -260,7 +259,8 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator() } //---------------------------------------------------------------------------- -void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf) +bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s, + cmMakefile* mf) { if(this->PlatformName == "x64") { @@ -273,6 +273,7 @@ void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf) mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str()); mf->AddDefinition("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION", this->GetIntelProjectVersion()); + return this->cmGlobalVisualStudioGenerator::SetSystemName(s, mf); } void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 291d297..bd84433 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -44,7 +44,7 @@ public: ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); - virtual void AddPlatformDefinitions(cmMakefile* mf); + virtual bool SetSystemName(std::string const& s, cmMakefile* mf); /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 67583de..1bac322 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -133,10 +133,17 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() } //---------------------------------------------------------------------------- -void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf) +void cmGlobalVisualStudio8Generator +::EnableLanguage(std::vector<std::string>const & lang, + cmMakefile *mf, bool optional) { - cmGlobalVisualStudio71Generator::AddPlatformDefinitions(mf); + this->AddPlatformDefinitions(mf); + cmGlobalVisualStudio7Generator::EnableLanguage(lang, mf, optional); +} +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf) +{ if(this->TargetsWindowsCE()) { mf->AddDefinition("CMAKE_VS_WINCE_VERSION", diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 07bccee..aea2f01 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -36,6 +36,8 @@ public: ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); + virtual void EnableLanguage(std::vector<std::string>const& languages, + cmMakefile *, bool optional); virtual void AddPlatformDefinitions(cmMakefile* mf); /** |