Merge topic 'cmoutputconverter-simplify'

b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2831
This commit is contained in:
Brad King
2019-01-29 14:17:13 +00:00
committed by Kitware Robot
25 changed files with 89 additions and 86 deletions
+3 -3
View File
@@ -33,7 +33,6 @@
#include "cmMSVC60LinkLineComputer.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmState.h"
@@ -2794,8 +2793,9 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
}
// Shorten the output name (in expected use case).
cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
std::string fname = converter.ConvertToRelativePath(
cmStateDirectory cmDir =
this->GetMakefiles()[0]->GetStateSnapshot().GetDirectory();
std::string fname = cmDir.ConvertToRelPathIfNotContained(
this->GetMakefiles()[0]->GetState()->GetBinaryDirectory(), outputs[0]);
// Associate the hash with this output.