From a8115deebe49565089af6477dc70f9085e988dc0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 14 Jun 2022 19:12:10 -0400 Subject: cmCommonTargetGenerator: fix linked target directory for multi-config builds Without this, `Ninja Multi-Config` generators were not getting the right directory to look for `Modules.json` files for module information. --- Source/cmCommonTargetGenerator.cxx | 4 ++++ 1 file changed, 4 insertions(+) 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 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)); } } -- cgit v0.12