diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2021-04-07 18:24:14 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2021-04-15 14:13:49 (GMT) |
commit | d5c3e4ac326328dd4ca48b12b27b11ea19d87363 (patch) | |
tree | 45d0f8e2a50582be6c89885fa52f36bb68d9080c /Source/cmake.cxx | |
parent | 13838bbb36dbfeb36243d661378732672477ac8a (diff) | |
download | CMake-d5c3e4ac326328dd4ca48b12b27b11ea19d87363.zip CMake-d5c3e4ac326328dd4ca48b12b27b11ea19d87363.tar.gz CMake-d5c3e4ac326328dd4ca48b12b27b11ea19d87363.tar.bz2 |
cmake: add support for --toolchain command argument
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a04338f..9191abd 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -509,6 +509,16 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args) return false; }; + auto ToolchainLambda = [&](std::string const& path, cmake* state) -> bool { + const std::string var = "CMAKE_TOOLCHAIN_FILE"; + cmStateEnums::CacheEntryType type = cmStateEnums::FILEPATH; +#ifndef CMAKE_BOOTSTRAP + state->UnprocessedPresetVariables.erase(var); +#endif + state->ProcessCacheArg(var, path, type); + return true; + }; + std::vector<CommandArgument> arguments = { CommandArgument{ "-D", "-D must be followed with VAR=VALUE.", CommandArgument::Values::One, DefineLambda }, @@ -530,6 +540,8 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args) CommandArgument{ "-P", "-P must be followed by a file name.", CommandArgument::Values::One, ScriptLambda }, + CommandArgument{ "--toolchain", "No file specified for --toolchain", + CommandArgument::Values::One, ToolchainLambda }, CommandArgument{ "--install-prefix", "No install directory specified for --install-prefix", CommandArgument::Values::One, PrefixLambda }, @@ -835,6 +847,8 @@ void cmake::SetArgs(const std::vector<std::string>& args) CommandArgument::Values::One, PlatformLambda }, CommandArgument{ "-T", "No toolset specified for -T", CommandArgument::Values::One, ToolsetLamda }, + CommandArgument{ "--toolchain", "No file specified for --toolchain", + CommandArgument::Values::One, IgnoreAndTrueLambda }, CommandArgument{ "--install-prefix", "No install directory specified for --install-prefix", CommandArgument::Values::One, IgnoreAndTrueLambda }, |