From 0fd8828dd2df121a336e4ac28a1c6610cb08a10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 18 Aug 2023 19:35:28 +0200 Subject: [PATCH] TextureTools: curse you, Xcode "new build system". Horrific trash fire that only keeps getting worse and apparently nobody is able to do anything about it. --- src/Magnum/TextureTools/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Magnum/TextureTools/CMakeLists.txt b/src/Magnum/TextureTools/CMakeLists.txt index 69bd564a9..7f13cfca5 100644 --- a/src/Magnum/TextureTools/CMakeLists.txt +++ b/src/Magnum/TextureTools/CMakeLists.txt @@ -129,6 +129,13 @@ if(MAGNUM_BUILD_TESTS) add_library(MagnumTextureToolsTestLib ${SHARED_OR_STATIC} ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} ${MagnumTextureTools_GracefulAssert_SRCS}) set_target_properties(MagnumTextureToolsTestLib PROPERTIES DEBUG_POSTFIX "-d") + 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 (MagnumTextureTools and + # MagnumTextureToolsTestLib) that don't have any other dependency + # between them. WTF. + add_dependencies(MagnumTextureToolsTestLib MagnumTextureTools) + endif() target_compile_definitions(MagnumTextureToolsTestLib PRIVATE "CORRADE_GRACEFUL_ASSERT" "MagnumTextureTools_EXPORTS") if(MAGNUM_BUILD_STATIC_PIC)