Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/cmake/CheckTestOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ endforeach()
configure("old build tree" upgraded OPTIONS -DOLD_TREE=ON -DENABLE_TESTING=ON -DENABLE_COVERAGE=ON)
configure("old cache is not migrated" upgraded OPTIONS -DOLD_TREE=OFF -DTOP_LEVEL=ON
EXPECT "TESTING=OFF LEGACY=ON" "COVERAGE=OFF LEGACY=ON")
# The same upgrade with Ninja, whatever the default generator of the machine (CMAKE_GENERATOR). Ninja refuses to
# generate a tree that declares no project, which the old-tree fixture once was (#514): it must keep generating.
find_program(ninja NAMES ninja-build ninja samu)
if(ninja)
configure("old build tree with Ninja" upgraded-ninja OPTIONS -G Ninja -DOLD_TREE=ON -DENABLE_TESTING=ON -DENABLE_COVERAGE=ON
EXPECT "Old tree generated with Ninja")
configure("old cache is not migrated with Ninja" upgraded-ninja OPTIONS -DOLD_TREE=OFF -DTOP_LEVEL=ON
EXPECT "TESTING=OFF LEGACY=ON" "COVERAGE=OFF LEGACY=ON")
endif()
configure("generic toolchain option" toolchain
OPTIONS -DTOP_LEVEL=ON "-DCMAKE_TOOLCHAIN_FILE=${ROOT}/test/cmake/test-options/Toolchain.cmake" -DTOOLCHAIN_LEGACY=ON
EXPECT "TESTING=OFF LEGACY=<unset>")
Expand Down
3 changes: 3 additions & 0 deletions test/cmake/test-options/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ if(OLD_TREE)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)
option(ENABLE_SANITIZER_ADDRESS "Enable address sanitizer" OFF)
message(STATUS "Former options of ${ROOT} declared")
# A generator such as Ninja refuses to generate a tree whose CMakeLists.txt never calls project() (#514).
project(TestOptions LANGUAGES NONE)
message(STATUS "Old tree generated with ${CMAKE_GENERATOR}")
return()
endif()
if(FIXTURE_VERSION)
Expand Down
Loading