summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-06-14 23:12:10 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2022-06-14 23:27:30 (GMT)
commita8115deebe49565089af6477dc70f9085e988dc0 (patch)
treed65368eb1556b5e55b90fc630cd0b5296875f27c
parentca8a5b05de811d6a95cfa7a33a2985f2b193967f (diff)
downloadCMake-a8115deebe49565089af6477dc70f9085e988dc0.zip
CMake-a8115deebe49565089af6477dc70f9085e988dc0.tar.gz
CMake-a8115deebe49565089af6477dc70f9085e988dc0.tar.bz2
cmCommonTargetGenerator: fix linked target directory for multi-config builds
Without this, `Ninja Multi-Config` generators were not getting the right directory to look for `<LANG>Modules.json` files for module information.
-rw-r--r--Source/cmCommonTargetGenerator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index ba95168..5fe6756 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -9,6 +9,7 @@
#include "cmComputeLinkInformation.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalCommonGenerator.h"
+#include "cmGlobalGenerator.h"
#include "cmLocalCommonGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
@@ -175,6 +176,9 @@ std::vector<std::string> cmCommonTargetGenerator::GetLinkedTargetDirectories(
cmLocalGenerator* lg = linkee->GetLocalGenerator();
std::string di = cmStrCat(lg->GetCurrentBinaryDirectory(), '/',
lg->GetTargetDirectory(linkee));
+ if (lg->GetGlobalGenerator()->IsMultiConfig()) {
+ di = cmStrCat(di, '/', config);
+ }
dirs.push_back(std::move(di));
}
}