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.
This commit is contained in:
parent
79af005cf8
commit
8b2a2db073
|
@ -146,9 +146,17 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
|
||||||
const char* cname = this->GetCMakeInstance()->
|
const char* cname = this->GetCMakeInstance()->
|
||||||
GetCacheManager()->GetCacheValue(langComp.c_str());
|
GetCacheManager()->GetCacheValue(langComp.c_str());
|
||||||
std::string changeVars;
|
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;
|
std::string pathString = path;
|
||||||
// get rid of potentially multiple slashes:
|
// get rid of potentially multiple slashes:
|
||||||
cmSystemTools::ConvertToUnixSlashes(cnameString);
|
cmSystemTools::ConvertToUnixSlashes(cnameString);
|
||||||
|
|
Loading…
Reference in New Issue