diff options
Diffstat (limited to 'Tests')
3 files changed, 22 insertions, 40 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/QtX-debug-in-release-graph-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/QtX-debug-in-release-graph-build-check.cmake new file mode 100644 index 0000000..2d8df13 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/QtX-debug-in-release-graph-build-check.cmake @@ -0,0 +1,7 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${AUTOGEN_FILES} + + ${TARGET_FILE_exe_Debug} + ${TARGET_OBJECT_FILES_exe_Debug} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/QtX.cmake b/Tests/RunCMake/NinjaMultiConfig/QtX.cmake index dded383..130f883 100644 --- a/Tests/RunCMake/NinjaMultiConfig/QtX.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/QtX.cmake @@ -19,17 +19,16 @@ if(${QtX}Core_VERSION VERSION_GREATER_EQUAL "5.15.0") set(moc_writes_depfiles 1) endif() -foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES) - set(autogen_files) +set(autogen_files) +if(moc_writes_depfiles) + list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/deps") + list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/timestamp") +endif() +foreach(c IN LISTS CMAKE_CONFIGURATION_TYPES) + list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/mocs_compilation_${c}.cpp") + list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${c}/moc_qt5.cpp") if(moc_writes_depfiles) - list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/deps_${CONFIG}") - list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/timestamp_${CONFIG}") + list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${c}/moc_qt5.cpp.d") endif() - list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/mocs_compilation_${CONFIG}.cpp") - list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${CONFIG}/moc_qt5.cpp") - if(moc_writes_depfiles) - list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${CONFIG}/moc_qt5.cpp.d") - endif() - file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(AUTOGEN_FILES_${CONFIG} [==[${autogen_files}]==])\n") - unset(autogen_files) endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(AUTOGEN_FILES [==[${autogen_files}]==])\n") diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index a39606d..0ccf8e8 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -486,35 +486,11 @@ if(CMake_TEST_Qt_version) "-D${QtX}Core_DIR=${${QtX}Core_DIR}" "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}" ) - - foreach(target_config IN ITEMS Debug Release RelWithDebInfo) - foreach(ninja_config IN ITEMS Debug Release RelWithDebInfo) - block() - run_cmake_configure(QtX) - include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) - run_cmake_build(QtX ${target_config}-in-${ninja_config}-graph ${ninja_config} exe:${target_config}) - check_files("${RunCMake_TEST_BINARY_DIR}" - INCLUDE - "${AUTOGEN_FILES_${target_config}}" - "${TARGET_FILE_exe_${target_config}}" - "${TARGET_OBJECT_FILES_exe_${target_config}}" - ) - if (DEFINED RunCMake_TEST_FAILED AND NOT RunCMake_TEST_FAILED STREQUAL "") - message(FATAL_ERROR "RunCMake_TEST_FAILED:${RunCMake_TEST_FAILED}") - endif() - - check_file_contents("${RunCMake_TEST_BINARY_DIR}/exe_autogen/deps_${target_config}" "exe_autogen/timestamp_${target_config}") - if (DEFINED RunCMake_TEST_FAILED AND NOT RunCMake_TEST_FAILED STREQUAL "") - message(FATAL_ERROR "RunCMake_TEST_FAILED:${RunCMake_TEST_FAILED}") - endif() - endblock() - endforeach() - endforeach() + run_cmake_configure(QtX) + unset(RunCMake_TEST_OPTIONS) + include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) + run_cmake_build(QtX debug-in-release-graph Release exe:Debug) if(CMake_TEST_${QtX}Core_Version VERSION_GREATER_EQUAL 5.15.0) - foreach(target_config IN ITEMS Debug Release RelWithDebInfo) - foreach(ninja_config IN ITEMS Debug Release RelWithDebInfo) - run_ninja(QtX automoc-check-${target_config} build-${ninja_config}.ninja -t query exe_autogen/timestamp_${target_config}) - endforeach() - endforeach() + run_ninja(QtX automoc-check build-Debug.ninja -t query exe_autogen/timestamp) endif() endif() |