diff options
author | Brad King <brad.king@kitware.com> | 2022-03-17 17:50:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-03-17 17:50:12 (GMT) |
commit | 36056ff5a38e72f2edf7f042d594d0356301bb9e (patch) | |
tree | 4d3524841fb026742a2e642079f4e7b695c010a5 /Source | |
parent | e91c23402ea8d260339533a0ca2895bddc8a3c22 (diff) | |
download | CMake-36056ff5a38e72f2edf7f042d594d0356301bb9e.zip CMake-36056ff5a38e72f2edf7f042d594d0356301bb9e.tar.gz CMake-36056ff5a38e72f2edf7f042d594d0356301bb9e.tar.bz2 |
cmake: Improve acceptance of arbitrary arguments in -P script mode
The fix in commit e4f1b301fe (cmake: Allow arbitrary args passed to
CMake script, 2020-05-04, v3.18.0-rc1~211^2) only applied to "cache"
arguments like `-DFOO`. Extend the fix to allow arbitrary arguments
that collide with other CMake arguments like `-S` and `-B`.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmake.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 81d225d..c41c26f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1158,6 +1158,12 @@ void cmake::SetArgs(const std::vector<std::string>& args) // iterate each argument std::string const& arg = args[i]; + if (scriptMode && arg == "--") { + // Stop processing CMake args and avoid possible errors + // when arbitrary args are given to CMake script. + break; + } + // Generator flag has special handling for when to print help // so it becomes the exception if (generatorCommand.matches(arg)) { |