diff options
author | Brad King <brad.king@kitware.com> | 2021-05-14 17:09:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-05-17 14:03:33 (GMT) |
commit | 4cb6a53bf524258c34440fc573ab6a9a4de0f0b2 (patch) | |
tree | 881979fb6ceeb4d286f14d2a05a24ca8af10b9f7 /Source/cmTarget.cxx | |
parent | 5b3a71a83faf913aa4a9644779ae35c9d5eda733 (diff) | |
download | CMake-4cb6a53bf524258c34440fc573ab6a9a4de0f0b2.zip CMake-4cb6a53bf524258c34440fc573ab6a9a4de0f0b2.tar.gz CMake-4cb6a53bf524258c34440fc573ab6a9a4de0f0b2.tar.bz2 |
cmListFileCache: Simplify relative path conversion in backtraces
Printing paths to CMake input files does not need to use the
generator-wide relative path conversion rules because we are not
actually generating a relative path for the build system that needs to
be consistent with anything else. Instead, simply print a relative path
if it does not need to start in `../`, and otherwise an absolute path.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f84d246..29e361c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -929,12 +929,10 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const const char* sigString = (sig == cmTarget::KeywordTLLSignature ? "keyword" : "plain"); s << "The uses of the " << sigString << " signature are here:\n"; - cmStateDirectory cmDir = - this->impl->Makefile->GetStateSnapshot().GetDirectory(); for (auto const& cmd : this->impl->TLLCommands) { if (cmd.first == sig) { cmListFileContext lfc = cmd.second; - lfc.FilePath = cmDir.ConvertToRelPathIfContained( + lfc.FilePath = cmSystemTools::RelativeIfUnder( this->impl->Makefile->GetState()->GetSourceDirectory(), lfc.FilePath); s << " * " << lfc << '\n'; } |