summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/NinjaMultiConfig
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-02-04 16:06:46 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-02-04 19:13:07 (GMT)
commit16a4ba5b311669000d83c99b1b985597205d3d69 (patch)
treed488198bc202d2daa0ef63a11fc47d81e420f801 /Tests/RunCMake/NinjaMultiConfig
parent2ac835b9f9a7a4dec16c498a51c0dbc3d64844bc (diff)
downloadCMake-16a4ba5b311669000d83c99b1b985597205d3d69.zip
CMake-16a4ba5b311669000d83c99b1b985597205d3d69.tar.gz
CMake-16a4ba5b311669000d83c99b1b985597205d3d69.tar.bz2
Ninja Multi-Config: Use build.ninja if cmake --build has no --config
If cmake --build is called with no --config argument, and a build.ninja file is available, use that instead of defaulting to the Debug config.
Diffstat (limited to 'Tests/RunCMake/NinjaMultiConfig')
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-build-check.cmake (renamed from Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-ninja-check.cmake)0
2 files changed, 8 insertions, 2 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 7518395..2344158 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -62,7 +62,12 @@ function(run_cmake_build case suffix config)
foreach(tgt IN LISTS ARGN)
list(APPEND tgts --target ${tgt})
endforeach()
- run_cmake_command(${case}-${suffix}-build "${CMAKE_COMMAND}" --build . --config ${config} ${tgts})
+ if(config)
+ set(config_arg --config ${config})
+ else()
+ set(config_arg)
+ endif()
+ run_cmake_command(${case}-${suffix}-build "${CMAKE_COMMAND}" --build . ${config_arg} ${tgts})
endfunction()
function(run_ninja case suffix file)
@@ -122,7 +127,8 @@ run_cmake_configure(SimpleDefaultBuildAliasList)
unset(RunCMake_TEST_OPTIONS)
include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
run_ninja(SimpleDefaultBuildAliasList target-configs build.ninja simpleexe)
-run_ninja(SimpleDefaultBuildAliasList all-configs build.ninja all)
+# IMPORTANT: This tests cmake --build . with no config using build.ninja
+run_cmake_build(SimpleDefaultBuildAliasList all-configs "" all)
run_ninja(SimpleDefaultBuildAliasList all-relwithdebinfo build.ninja all:RelWithDebInfo)
run_ninja(SimpleDefaultBuildAliasList clean-configs build.ninja clean)
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-build-check.cmake
index 8ffdd20..8ffdd20 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-build-check.cmake