diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-25 17:54:23 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-29 07:54:31 (GMT) |
commit | 241304190ffdf9cc7d4ede0601da370b111468cc (patch) | |
tree | e35dd7fe5c89da1eed3abe10f37abe3586e64df7 /Source/cmFileAPIToolchains.cxx | |
parent | 87fe031a0703f07b8636f8ea59b6746788e71869 (diff) | |
download | CMake-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/cmFileAPIToolchains.cxx')
-rw-r--r-- | Source/cmFileAPIToolchains.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmFileAPIToolchains.cxx b/Source/cmFileAPIToolchains.cxx index fe2972f..a51ae20 100644 --- a/Source/cmFileAPIToolchains.cxx +++ b/Source/cmFileAPIToolchains.cxx @@ -10,6 +10,7 @@ #include "cmFileAPI.h" #include "cmGlobalGenerator.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmState.h" #include "cmStringAlgorithms.h" @@ -124,10 +125,11 @@ void Toolchains::DumpToolchainVariable(cmMakefile const* mf, cmStrCat("CMAKE_", lang, "_", variable.VariableSuffix); if (variable.IsList) { - std::vector<std::string> values; - if (mf->GetDefExpandList(variableName, values)) { + cmValue data = mf->GetDefinition(variableName); + if (data) { + cmList values(data); Json::Value jsonArray = Json::arrayValue; - for (std::string const& value : values) { + for (auto const& value : values) { jsonArray.append(value); } object[variable.ObjectKey] = jsonArray; |