summaryrefslogtreecommitdiff
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2021-04-26 11:51:27 -0400
committerRobert Maynard <rmaynard@nvidia.com>2021-04-28 17:22:25 -0400
commita9b968bb9894902e2183a4aea4c23701d5666733 (patch)
treeb41ad0388074d1ea666f0e210e69ec389f3d2ff7 /Source/cmake.cxx
parent0eb42defc222372b660983ac46ea1266543af7e0 (diff)
downloadcmake-a9b968bb9894902e2183a4aea4c23701d5666733.tar.gz
cmake-presets: Introduce `toolchainFile` preset option
In v3 of the presets, the `--toolchain` command line argument now has a preset mapping.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index d24e268d45..4130f5fbf2 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1257,6 +1257,13 @@ void cmake::SetArgs(const std::vector<std::string>& args)
"PATH", expandedPreset->InstallDir
};
}
+ if (!expandedPreset->ToolchainFile.empty() &&
+ this->State->GetInitializedCacheValue("CMAKE_TOOLCHAIN_FILE") ==
+ nullptr) {
+ this->UnprocessedPresetVariables["CMAKE_TOOLCHAIN_FILE"] = {
+ "FILEPATH", expandedPreset->ToolchainFile
+ };
+ }
if (!expandedPreset->ArchitectureStrategy ||
expandedPreset->ArchitectureStrategy ==