Autogen: Different configs depend on the same `timestamp` file when a multi-config generator is used and cross-config is not enabled
This MR refactored the dependency graph of autogen
. In the current situation, when cross-config
is enabled, CMake
generates timestamp_<CONFIG>
files for each config and config-based dependencies. The benefits of this behavior are both performance improvement by not building redundant files related to other configs and providing better usage for per-config values with AUTO*_EXECUTABLE
s.
But when cross-config
is not enabled, each config depends on the same timestamp
file. This makes other config builds outdated when another config is built.
Probably the root cause of this CI failure.
Example output
The below command runs each config build one after another twice but although those configs are built, CMake
works as those configs are outdated.
rm -rf build && cmake -S . -B build/ -G "Ninja Multi-Config" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PREFIX_PATH="~/Qt/6.5.0/gcc_64" && cmake --build build --parallel 25 --config Debug && cmake --build build --parallel 25 --config Release && c
make --build build --parallel 25 --config Debug && cmake --build build --parallel 25 --config Release
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_AUTOUIC:
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.4.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/orkun/playground/mini_ui_example/build
[5/5] Linking CXX executable Debug/mini_ui_example
[5/5] Linking CXX executable Release/mini_ui_example
[1/3] Automatic MOC and UIC for target mini_ui_example
[1/3] Automatic MOC and UIC for target mini_ui_example
Expected Output
> rm -rf build && cmake -S . -B build/ -G "Ninja Multi-Config" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PREFIX_PATH="~/Qt/6.5.0/gcc_64" && cmake --build build --parallel 25 --config Debug && cmake --build build --parallel 25 --config Release && c
make --build build --parallel 25 --config Debug && cmake --build build --parallel 25 --config Release
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_AUTOUIC:
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.4.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/orkun/playground/mini_ui_example/build
[5/5] Linking CXX executable Debug/mini_ui_example
[4/4] Linking CXX executable Release/mini_ui_example
ninja: no work to do.
ninja: no work to do.
Example Project
Edited by Orkun Tokdemir