From 082ca911abc31c968adf4af2bb6016d1cff12c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Apr 2016 12:00:50 +0200 Subject: [PATCH] Platform: fix building of EglContext with Xcode. The dreaded OBJECT libraries again. Reported the inconvenience here: http://public.kitware.com/pipermail/cmake/2016-April/063178.html --- src/Magnum/CMakeLists.txt | 2 +- src/Magnum/Platform/CMakeLists.txt | 4 +++- src/Magnum/{Math => }/dummy.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) rename src/Magnum/{Math => }/dummy.cpp (94%) diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index f973fc170..52257c48f 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -323,7 +323,7 @@ if(BUILD_TESTS) # Library with graceful assert for testing add_library(MagnumMathTestLib ${SHARED_OR_STATIC} $ - Math/dummy.cpp) # XCode workaround, see file comment for details + dummy.cpp) # XCode workaround, see file comment for details target_include_directories(MagnumMathTestLib PUBLIC $) target_compile_definitions(MagnumMathTestLib PRIVATE "CORRADE_GRACEFUL_ASSERT") set_target_properties(MagnumMathTestLib PROPERTIES DEBUG_POSTFIX "-d") diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index f9e870a60..a22eb719d 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -578,7 +578,9 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT) # Also create proper static library, if requested if(WITH_EGLCONTEXT) - add_library(MagnumEglContext STATIC $) + add_library(MagnumEglContext STATIC + $ + dummy.cpp) # XCode workaround, see file comment for details set_target_properties(MagnumEglContext PROPERTIES DEBUG_POSTFIX "-d") if(BUILD_STATIC_PIC) set_target_properties(MagnumEglContext PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/src/Magnum/Math/dummy.cpp b/src/Magnum/dummy.cpp similarity index 94% rename from src/Magnum/Math/dummy.cpp rename to src/Magnum/dummy.cpp index 454fc1bd7..02a434d1f 100644 --- a/src/Magnum/Math/dummy.cpp +++ b/src/Magnum/dummy.cpp @@ -26,5 +26,5 @@ /* XCode-generated project files have a limitation that you can't create a library target from OBJECT sources only and you have to provide at least one file. Otherwise the generated library gets replaced with self-pointing - symlink and the build then obviously fails with "File not found" error. That - affected the MagnumMathTestLib library and this file should fix it. */ + symlink and the build then obviously fails with "File not found" error. + Related: http://public.kitware.com/pipermail/cmake/2016-April/063178.html */