summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2022-07-21 13:52:28 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-22 18:30:21 (GMT)
commit14a0e750cb33f09faf01134c420483d358d0fae8 (patch)
tree183b4de6a38b912fff56947ef25eb783320ccf92 /Tests
parentfebe3190f0782d3c2efdd4115e563632ec8b41b7 (diff)
downloadCMake-14a0e750cb33f09faf01134c420483d358d0fae8.zip
CMake-14a0e750cb33f09faf01134c420483d358d0fae8.tar.gz
CMake-14a0e750cb33f09faf01134c420483d358d0fae8.tar.bz2
cmake: In -P mode ignore flags like `--version` after `--`
Fixes: #21031
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/P_arbitrary_args-stdout.txt5
-rw-r--r--Tests/RunCMake/CommandLine/P_arbitrary_args.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
3 files changed, 5 insertions, 3 deletions
diff --git a/Tests/RunCMake/CommandLine/P_arbitrary_args-stdout.txt b/Tests/RunCMake/CommandLine/P_arbitrary_args-stdout.txt
index c94c19d..cde76f7 100644
--- a/Tests/RunCMake/CommandLine/P_arbitrary_args-stdout.txt
+++ b/Tests/RunCMake/CommandLine/P_arbitrary_args-stdout.txt
@@ -1,4 +1,4 @@
-^-- CMAKE_ARGC='8'
+^-- CMAKE_ARGC='9'
-- CMAKE_ARGV1='-P'
-- CMAKE_ARGV2='[^']*/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake'
-- CMAKE_ARGV3='--'
@@ -6,4 +6,5 @@
-- CMAKE_ARGV5='-S'
-- CMAKE_ARGV6='-B'
-- CMAKE_ARGV7='--fresh'
--- CMAKE_ARGV8=''$
+-- CMAKE_ARGV8='--version'
+-- CMAKE_ARGV9=''$
diff --git a/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake b/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake
index 8dca990..7d79af5 100644
--- a/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake
+++ b/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake
@@ -7,3 +7,4 @@ message(STATUS "CMAKE_ARGV5='${CMAKE_ARGV5}'")
message(STATUS "CMAKE_ARGV6='${CMAKE_ARGV6}'")
message(STATUS "CMAKE_ARGV7='${CMAKE_ARGV7}'")
message(STATUS "CMAKE_ARGV8='${CMAKE_ARGV8}'")
+message(STATUS "CMAKE_ARGV9='${CMAKE_ARGV9}'")
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 1663fa8..fc05b2d 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -53,7 +53,7 @@ run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -B DummyBuildDir -G NoSuchGenerator
run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
run_cmake_command(P_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_args.cmake" relative/path "${RunCMake_SOURCE_DIR}")
-run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO -S -B --fresh)
+run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO -S -B --fresh --version)
run_cmake_command(P_fresh ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_fresh.cmake" --fresh)
run_cmake_command(build-no-dir