diff options
author | Brad King <brad.king@kitware.com> | 2015-05-07 18:01:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-05-07 18:02:44 (GMT) |
commit | 378c2a0e860f32e0435844d7d6af79a4fdc2b455 (patch) | |
tree | 3ab57abbcb7c76aeeafe4ff28316284ceea122af /Source/cmGlobalNinjaGenerator.h | |
parent | 957c2aac7fb4833b333cf3362cb8c6918a8e8a82 (diff) | |
download | CMake-378c2a0e860f32e0435844d7d6af79a4fdc2b455.zip CMake-378c2a0e860f32e0435844d7d6af79a4fdc2b455.tar.gz CMake-378c2a0e860f32e0435844d7d6af79a4fdc2b455.tar.bz2 |
Ninja: Refactor detection of MinGW tools on Windows
Check for CMAKE_COMPILER_IS_MINGW only after enabling a language when it
might actually be set. Previously this worked by accident because the
check for working compiler or a second language enabled would cause the
code path to be taken.
Store UsingMinGW as an instance member of cmGlobalNinjaGenerator so that
it is reset on each reconfigure. Otherwise cmake-gui cannot switch
between build trees for MinGW or non-MinGW tools.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.h')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index d7b3add..9b6717a 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -63,7 +63,7 @@ public: static std::string EncodeIdent(const std::string &ident, std::ostream &vars); static std::string EncodeLiteral(const std::string &lit); - static std::string EncodePath(const std::string &path); + std::string EncodePath(const std::string &path); static std::string EncodeDepfileSpace(const std::string &path); /** @@ -155,9 +155,7 @@ public: const cmNinjaDeps& targets, const std::string& comment = ""); - - static bool IsMinGW() { return UsingMinGW; } - + bool IsMinGW() const { return this->UsingMinGW; } public: /// Default constructor. @@ -362,6 +360,8 @@ private: /// The set of dependencies to add to the "all" target. cmNinjaDeps AllDependencies; + bool UsingMinGW; + /// The set of custom commands we have seen. std::set<cmCustomCommand const*> CustomCommands; @@ -385,9 +385,6 @@ private: typedef std::map<std::string, cmTarget*> TargetAliasMap; TargetAliasMap TargetAliases; - - static bool UsingMinGW; - }; #endif // ! cmGlobalNinjaGenerator_h |