summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-04-25 17:54:23 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-04-29 07:54:31 (GMT)
commit241304190ffdf9cc7d4ede0601da370b111468cc (patch)
treee35dd7fe5c89da1eed3abe10f37abe3586e64df7 /Source/cmNinjaNormalTargetGenerator.cxx
parent87fe031a0703f07b8636f8ea59b6746788e71869 (diff)
downloadCMake-241304190ffdf9cc7d4ede0601da370b111468cc.zip
CMake-241304190ffdf9cc7d4ede0601da370b111468cc.tar.gz
CMake-241304190ffdf9cc7d4ede0601da370b111468cc.tar.bz2
CMake code rely on cmList class for CMake lists management (part. 2)
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 091acd6..ee4fa90 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -610,7 +610,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeDeviceLinkCmd()
{
- std::vector<std::string> linkCmds;
+ cmList linkCmds;
// this target requires separable cuda compilation
// now build the correct command depending on if the target is
@@ -619,23 +619,23 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeDeviceLinkCmd()
case cmStateEnums::STATIC_LIBRARY:
case cmStateEnums::SHARED_LIBRARY:
case cmStateEnums::MODULE_LIBRARY: {
- this->GetMakefile()->GetDefExpandList("CMAKE_CUDA_DEVICE_LINK_LIBRARY",
- linkCmds);
+ linkCmds.assign(
+ this->GetMakefile()->GetDefinition("CMAKE_CUDA_DEVICE_LINK_LIBRARY"));
} break;
case cmStateEnums::EXECUTABLE: {
- this->GetMakefile()->GetDefExpandList(
- "CMAKE_CUDA_DEVICE_LINK_EXECUTABLE", linkCmds);
+ linkCmds.assign(this->GetMakefile()->GetDefinition(
+ "CMAKE_CUDA_DEVICE_LINK_EXECUTABLE"));
} break;
default:
break;
}
- return linkCmds;
+ return std::move(linkCmds.data());
}
std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
const std::string& config)
{
- std::vector<std::string> linkCmds;
+ cmList linkCmds;
cmMakefile* mf = this->GetMakefile();
{
// If we have a rule variable prefer it. In the case of static libraries
@@ -654,7 +654,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
linkCmdStr += *rule;
}
}
- cmExpandList(linkCmdStr, linkCmds);
+ linkCmds.assign(linkCmdStr);
if (this->UseLWYU) {
cmValue lwyuCheck = mf->GetDefinition("CMAKE_LINK_WHAT_YOU_USE_CHECK");
if (lwyuCheck) {
@@ -673,7 +673,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
linkCmds.push_back(std::move(cmakeCommand));
}
}
- return linkCmds;
+ return std::move(linkCmds.data());
}
}
switch (this->GetGeneratorTarget()->GetType()) {
@@ -694,7 +694,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
linkCmdVar, this->TargetLinkLanguage(config), config);
std::string const& linkCmd = mf->GetRequiredDefinition(linkCmdVar);
- cmExpandList(linkCmd, linkCmds);
+ linkCmds.append(linkCmd);
}
{
std::string linkCmdVar = cmStrCat(
@@ -704,7 +704,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
linkCmdVar, this->TargetLinkLanguage(config), config);
std::string const& linkCmd = mf->GetRequiredDefinition(linkCmdVar);
- cmExpandList(linkCmd, linkCmds);
+ linkCmds.append(linkCmd);
}
#ifdef __APPLE__
// On macOS ranlib truncates the fractional part of the static archive
@@ -728,7 +728,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
default:
assert(false && "Unexpected target type");
}
- return linkCmds;
+ return std::move(linkCmds.data());
}
void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement(