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.
This commit is contained in:
Brad King
2015-05-07 14:01:58 -04:00
parent 957c2aac7f
commit 378c2a0e86
3 changed files with 16 additions and 21 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
// needed by cmcldeps
false,
this->GetConfigName());
if(cmGlobalNinjaGenerator::IsMinGW())
if (this->GetGlobalGenerator()->IsMinGW())
cmSystemTools::ReplaceString(includeFlags, "\\", "/");
this->LocalGenerator->AppendFlags(languageFlags, includeFlags);