summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-28 16:35:15 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-28 16:35:24 (GMT)
commita4d7a79beb3c3431f900e184678bdc66133653bf (patch)
tree05d5f0983e5b1ef2becb5d7fc96df473de282446 /Tests/RunCMake
parent7706b6a71406b535ffe2f707647126eac4a8c767 (diff)
parentccaa0bccc42a31f7515c6f85a0601ac0ad006e96 (diff)
downloadCMake-a4d7a79beb3c3431f900e184678bdc66133653bf.zip
CMake-a4d7a79beb3c3431f900e184678bdc66133653bf.tar.gz
CMake-a4d7a79beb3c3431f900e184678bdc66133653bf.tar.bz2
Merge topic 'ninja-1.10'
ccaa0bccc4 Ninja: Do not clean metadata when re-generating inside a running build 657820a00b Ninja: Track when running to re-generate during a build b12b013028 Ninja: Factor metadata cleanup into dedicated method 5d92e60d81 Ninja: Skip cleandead and recompact if build.ninja is missing dd0a4718fd Ninja: Fix CMAKE_NINJA_OUTPUT_PATH_PREFIX with Ninja 1.10 0944caaebb Tests: Fix RunCMake.CMP0037 test with Ninja 1.10 9d4883cce5 Tests: Fix RunCMake.Ninja test for Ninja 1.10 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4290
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMP0037/RunCMakeTest.cmake25
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandJobPool.cmake1
2 files changed, 24 insertions, 2 deletions
diff --git a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
index 98274f0..5952279 100644
--- a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
@@ -1,5 +1,24 @@
include(RunCMake)
+if(RunCMake_GENERATOR MATCHES "^Ninja")
+ # Detect ninja version so we know what tests can be supported.
+ execute_process(
+ COMMAND "${RunCMake_MAKE_PROGRAM}" --version
+ OUTPUT_VARIABLE ninja_out
+ ERROR_VARIABLE ninja_out
+ RESULT_VARIABLE ninja_res
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(ninja_res EQUAL 0 AND "x${ninja_out}" MATCHES "^x[0-9]+\\.[0-9]+")
+ set(ninja_version "${ninja_out}")
+ message(STATUS "ninja version: ${ninja_version}")
+ else()
+ message(FATAL_ERROR "'ninja --version' reported:\n${ninja_out}")
+ endif()
+else()
+ set(ninja_version "")
+endif()
+
run_cmake(CMP0037-OLD-space)
run_cmake(CMP0037-NEW-space)
run_cmake(CMP0037-WARN-space)
@@ -9,8 +28,10 @@ if(NOT (WIN32 AND "${RunCMake_GENERATOR}" MATCHES "Make"))
run_cmake(CMP0037-WARN-colon)
endif()
-run_cmake(CMP0037-WARN-reserved)
-run_cmake(CMP0037-OLD-reserved)
+if(NOT ninja_version VERSION_GREATER_EQUAL 1.10)
+ run_cmake(CMP0037-WARN-reserved)
+ run_cmake(CMP0037-OLD-reserved)
+endif()
run_cmake(CMP0037-NEW-reserved)
run_cmake(NEW-cond)
diff --git a/Tests/RunCMake/Ninja/CustomCommandJobPool.cmake b/Tests/RunCMake/Ninja/CustomCommandJobPool.cmake
index 1e36e65..a96802a 100644
--- a/Tests/RunCMake/Ninja/CustomCommandJobPool.cmake
+++ b/Tests/RunCMake/Ninja/CustomCommandJobPool.cmake
@@ -1,3 +1,4 @@
+set_property(GLOBAL PROPERTY JOB_POOLS custom_command_pool=2 custom_target_pool=2)
add_custom_command(
OUTPUT hello.copy.c
COMMAND "${CMAKE_COMMAND}" -E copy