diff options
author | Brad King <brad.king@kitware.com> | 2015-06-23 18:56:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-06-25 13:14:26 (GMT) |
commit | 30c2e1dd16e061fbabffa35816cb893d81ff0dcf (patch) | |
tree | e4409727504fc359fe48c8509601fc124277e371 /Source/cmTargetLinkLibrariesCommand.cxx | |
parent | a6916a6c6e397bda8b381f65dbfc59d3c52f8525 (diff) | |
download | CMake-30c2e1dd16e061fbabffa35816cb893d81ff0dcf.zip CMake-30c2e1dd16e061fbabffa35816cb893d81ff0dcf.tar.gz CMake-30c2e1dd16e061fbabffa35816cb893d81ff0dcf.tar.bz2 |
cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626)
Since commit v3.3.0-rc1~62^2~5 (cmTarget: Store only cmListFileContext
for CMP0023 handling, 2015-05-18) a call to target_link_libraries on a
target that was defined in another (non-ancestor) directory crashes
because no execution context is left active. Fix this by getting the
execution context from the actual cmMakefile where the current
target_link_libraries call takes place. Test this by verifying that
such calls correctly produce an error diagnostic instead of crashing.
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r-- | Source/cmTargetLinkLibrariesCommand.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index df37d66..b57b921 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -368,7 +368,8 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, || this->CurrentProcessingState == ProcessingKeywordPublicInterface || this->CurrentProcessingState == ProcessingKeywordLinkInterface) ? cmTarget::KeywordTLLSignature : cmTarget::PlainTLLSignature; - if (!this->Target->PushTLLCommandTrace(sig)) + if (!this->Target->PushTLLCommandTrace( + sig, this->Makefile->GetExecutionContext())) { std::ostringstream e; const char *modal = 0; |