mirror of
https://github.com/reactos/CMake.git
synced 2025-02-25 22:45:40 +00:00
Tests: Fix RunCMake.CMP0037 test with Ninja 1.10
The CMP0037 OLD and WARN cases that actually use reserved target names like `all` produce `build.ninja` files with duplicate build statements producing the same output. With Ninja 1.10 and above we run ninja tools at the end of generation that require `build.ninja` to be loadable. It is not loadable for these test cases, so skip them.
This commit is contained in:
parent
9d4883cce5
commit
0944caaebb
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user