From b289be313460756f56d31a6555bbad738556ca4f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 4 Feb 2024 17:31:38 -0500 Subject: [PATCH] Fix Linux CI. Per @dpogue, the problem is https://gitlab.kitware.com/cmake/cmake/-/issues/25650. Long story short, CMake broke PCH and Unity on CMake 3.28.2, so disable that combination when it's used. --- cmake/PlasmaTargets.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/PlasmaTargets.cmake b/cmake/PlasmaTargets.cmake index 584dfa5e5b..662660dcb8 100644 --- a/cmake/PlasmaTargets.cmake +++ b/cmake/PlasmaTargets.cmake @@ -9,11 +9,17 @@ cmake_dependent_option( OFF ) +# CMake 3.28.2 breaks precompiled headers and unity builds. +# Debounce this known bad combination. +if(CMAKE_VERSION VERSION_EQUAL 3.28.2 AND PLASMA_USE_PCH AND CMAKE_GENERATOR MATCHES Ninja|Makefiles) + set(_UNITY_BROKEN TRUE) +endif() + cmake_dependent_option( PLASMA_UNITY_BUILD "Enable unity build?" ON - "CMAKE_VERSION VERSION_GREATER_EQUAL 3.16;ALLOW_BUILD_OPTIMIZATIONS" + "CMAKE_VERSION VERSION_GREATER_EQUAL 3.16;ALLOW_BUILD_OPTIMIZATIONS;NOT _UNITY_BROKEN" OFF )