diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-08-19 12:12:56 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-08-19 12:35:14 (GMT) |
commit | 8b2a2db0735a836c6ebe40458b9a95ac08e61ea9 (patch) | |
tree | 2bf4d697c0402e3332df40933897bdb77ad5d202 /Source/cmGlobalGenerator.cxx | |
parent | 79af005cf8d58575315916c24d8cd518065ab3c2 (diff) | |
download | CMake-8b2a2db0735a836c6ebe40458b9a95ac08e61ea9.zip CMake-8b2a2db0735a836c6ebe40458b9a95ac08e61ea9.tar.gz CMake-8b2a2db0735a836c6ebe40458b9a95ac08e61ea9.tar.bz2 |
Fix resetting the compiler on the command line (#14366).
Convert the incoming value to a path in the same way that the
already-cached value was converted before comparison.
Do the actual comparison only one time, after both values are
normalized.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 7f2b592..799bbdb 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -146,9 +146,17 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, const char* cname = this->GetCMakeInstance()-> GetCacheManager()->GetCacheValue(langComp.c_str()); std::string changeVars; - if(cname && (path != cname) && (optional==false)) + if(cname && !optional) { - std::string cnameString = cname; + std::string cnameString; + if(!cmSystemTools::FileIsFullPath(cname)) + { + cnameString = cmSystemTools::FindProgram(cname); + } + else + { + cnameString = cname; + } std::string pathString = path; // get rid of potentially multiple slashes: cmSystemTools::ConvertToUnixSlashes(cnameString); |