diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake index 34aa164f63..e04dea3d1c 100644 --- a/.gitlab/ci/ctest_exclusions.cmake +++ b/.gitlab/ci/ctest_exclusions.cmake @@ -42,13 +42,6 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "_valgrind") ) endif() -if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "_xcode") - list(APPEND test_exclusions - # FIXME(#27358): Qt6Autogen.RerunMocOnAddFile fails in Xcode. - "^Qt6Autogen.RerunMocOnAddFile$" - ) -endif() - if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "^macos_x86_64_") list(APPEND test_exclusions # FIXME(#27376): CMakeGUI's simpleConfigure:fail case hangs. diff --git a/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt b/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt index 3a9244d2f8..1184fb3f83 100644 --- a/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt +++ b/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt @@ -27,6 +27,21 @@ endmacro() macro(rebuild buildName) message(STATUS "Starting build ${buildName}.") + # Work around CMake issue #27611: The Xcode build system creates its build + # plan at the start of a build and does not pick up project file changes + # made by ZERO_CHECK during the build. Explicitly re-run CMake to ensure + # the project file includes new sources before the native build tool starts. + if(CMAKE_GENERATOR MATCHES "Xcode") + execute_process( + COMMAND "${CMAKE_COMMAND}" -S "${testProjectSrc}" -B "${testProjectBinDir}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE output + ) + if (result) + message(FATAL_ERROR "CMake reconfigure for build ${buildName} failed. Output: ${output}") + endif() + endif() execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${testProjectBinDir}" RESULT_VARIABLE result) if (result) message(FATAL_ERROR "Build ${buildName} failed.")