summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetCompileDefinitionsCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-22 14:58:46 (GMT)
committerBrad King <brad.king@kitware.com>2022-08-22 19:29:43 (GMT)
commit52c95540b722926ba833ead05a575189bdabf84e (patch)
treeb620d3dfeaabb69d61a9e3c2413a0d73692d6968 /Source/cmTargetCompileDefinitionsCommand.cxx
parent0d64c3abd13a0b14f1a14b7717dbac8988d12256 (diff)
downloadCMake-52c95540b722926ba833ead05a575189bdabf84e.zip
CMake-52c95540b722926ba833ead05a575189bdabf84e.tar.gz
CMake-52c95540b722926ba833ead05a575189bdabf84e.tar.bz2
target_*: Fix cross-directory call backtraces
Record the call-site backtrace, not the current backtrace of the target's directory. Fixes: #23873
Diffstat (limited to 'Source/cmTargetCompileDefinitionsCommand.cxx')
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx
index b56b245..268bfac 100644
--- a/Source/cmTargetCompileDefinitionsCommand.cxx
+++ b/Source/cmTargetCompileDefinitionsCommand.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmTargetCompileDefinitionsCommand.h"
+#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmStringAlgorithms.h"
@@ -28,7 +29,8 @@ private:
const std::vector<std::string>& content,
bool /*prepend*/, bool /*system*/) override
{
- tgt->AppendProperty("COMPILE_DEFINITIONS", this->Join(content));
+ tgt->AppendProperty("COMPILE_DEFINITIONS", this->Join(content),
+ this->Makefile->GetBacktrace());
return true; // Successfully handled.
}