summaryrefslogtreecommitdiffstats
path: root/Source/cmCommonTargetGenerator.cxx
diff options
context:
space:
mode:
authorBobby D Reynolds <boreynol@microsoft.com>2021-05-18 15:57:02 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-28 16:28:43 (GMT)
commitae108418ae45aff7740605bb7add3843b050d226 (patch)
tree1b46b02e2c567538b0437fed2aef91564cd8f577 /Source/cmCommonTargetGenerator.cxx
parent92c8b83641eae61700d16602e0b60d9c9c6f3b15 (diff)
downloadCMake-ae108418ae45aff7740605bb7add3843b050d226.zip
CMake-ae108418ae45aff7740605bb7add3843b050d226.tar.gz
CMake-ae108418ae45aff7740605bb7add3843b050d226.tar.bz2
Launchers: Support setting linker launchers
Fixes: #18316
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r--Source/cmCommonTargetGenerator.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 0c5a7df..7c2e20c 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -15,6 +15,7 @@
#include "cmMakefile.h"
#include "cmOutputConverter.h"
#include "cmProperty.h"
+#include "cmRange.h"
#include "cmSourceFile.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
@@ -291,3 +292,24 @@ void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags,
this->LocalCommonGenerator->AppendFlags(flags, vflag.str());
}
}
+
+std::string cmCommonTargetGenerator::GetLinkerLauncher(
+ const std::string& config)
+{
+ std::string lang = this->GeneratorTarget->GetLinkerLanguage(config);
+ cmProp launcherProp =
+ this->GeneratorTarget->GetProperty(lang + "_LINKER_LAUNCHER");
+ if (cmNonempty(launcherProp)) {
+ // Convert ;-delimited list to single string
+ std::vector<std::string> args = cmExpandedList(*launcherProp, true);
+ if (!args.empty()) {
+ args[0] = this->LocalCommonGenerator->ConvertToOutputFormat(
+ args[0], cmOutputConverter::SHELL);
+ for (std::string& i : cmMakeRange(args.begin() + 1, args.end())) {
+ i = this->LocalCommonGenerator->EscapeForShell(i);
+ }
+ return cmJoin(args, " ");
+ }
+ }
+ return std::string();
+}