summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-18 11:20:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-18 11:20:24 (GMT)
commit5dbd068827510496a5561c07e2e7221b8090b241 (patch)
tree1596babf6fc0de3887e3d8c94bee0c9fcbf1f039 /Source/cmake.cxx
parent41b5f49eff605910736ec93f1fca4e539319b693 (diff)
parent36056ff5a38e72f2edf7f042d594d0356301bb9e (diff)
downloadCMake-5dbd068827510496a5561c07e2e7221b8090b241.zip
CMake-5dbd068827510496a5561c07e2e7221b8090b241.tar.gz
CMake-5dbd068827510496a5561c07e2e7221b8090b241.tar.bz2
Merge topic 'cmake-P-args'
36056ff5a3 cmake: Improve acceptance of arbitrary arguments in -P script mode Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7083
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f211314..a602458 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)) {