mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-09 23:44:00 +03:00
cmConditionEvaluator: Drop unnecessary path conversion
In commit v3.4.0-rc2~1^2 (cmIfCommand: Issue CMP0054 warning with appropriate context, 2015-10-20) we added construction of a cmListFileContext with conversion of the calling file path. This code path runs on every condition (e.g. `if()`) and so the path conversion has a noticeable performance cost. Fortunately the only use of this context is for insertion into cmMakefile::CMP0054ReportedIds so we do not need to convert the path. Simply drop the conversion.
This commit is contained in:
1 parent
90f24f016e
commit
02fce523a1
1 file changed
+1
-8
@@ -105,7 +105,7 @@ bool cmConditionEvaluator::IsTrue(
|
||||
}
|
||||
|
||||
cmListFileContext cmConditionEvaluator::GetConditionContext(
|
||||
cmMakefile* mf,
|
||||
cmMakefile*,
|
||||
const cmCommandContext& command,
|
||||
const std::string& filePath)
|
||||
{
|
||||
@@ -113,13 +113,6 @@ cmListFileContext cmConditionEvaluator::GetConditionContext(
|
||||
cmListFileContext::FromCommandContext(
|
||||
command,
|
||||
filePath);
|
||||
|
||||
if(!mf->GetCMakeInstance()->GetIsInTryCompile())
|
||||
{
|
||||
cmOutputConverter converter(mf->GetStateSnapshot());
|
||||
context.FilePath = converter.Convert(context.FilePath,
|
||||
cmOutputConverter::HOME);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user