From 0120ca84a26195b46b9b6abe9626620a8713678e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 14 Aug 2023 18:53:06 +0200 Subject: [PATCH] Utility: fix another CMake error with Xcode "new build system". New build system and it's clearly worse than the old. Typical 2020s, yes. --- src/Corrade/Utility/Test/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Corrade/Utility/Test/CMakeLists.txt b/src/Corrade/Utility/Test/CMakeLists.txt index 55023c568..4ae52591a 100644 --- a/src/Corrade/Utility/Test/CMakeLists.txt +++ b/src/Corrade/Utility/Test/CMakeLists.txt @@ -423,6 +423,13 @@ if(CORRADE_BUILD_STATIC AND NOT CORRADE_TARGET_EMSCRIPTEN AND NOT CORRADE_TARGET add_library(UtilityGlobalStateAcrossLibrariesLibrary SHARED GlobalStateAcrossLibrariesLibrary.cpp ${ResourceTestData}) + if(CMAKE_GENERATOR STREQUAL Xcode) + # Xcode's "new build system" doesn't like when the same (generated) + # source file is used by two different targets (ResourceTestDataLib and + # UtilityGlobalStateAcrossLibrariesLibrary) that don't have any other + # dependency between them. WTF. + add_dependencies(UtilityGlobalStateAcrossLibrariesLibrary ResourceTestDataLib) + endif() target_link_libraries(UtilityGlobalStateAcrossLibrariesLibrary PRIVATE CorradeUtility) corrade_add_test(UtilityGlobalStateAcrossLibrariesTest