Browse Source

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
pull/141/head
Vladimír Vondruš 10 years ago
parent
commit
082ca911ab
  1. 2
      src/Magnum/CMakeLists.txt
  2. 4
      src/Magnum/Platform/CMakeLists.txt
  3. 4
      src/Magnum/dummy.cpp

2
src/Magnum/CMakeLists.txt

@ -323,7 +323,7 @@ if(BUILD_TESTS)
# Library with graceful assert for testing # Library with graceful assert for testing
add_library(MagnumMathTestLib ${SHARED_OR_STATIC} add_library(MagnumMathTestLib ${SHARED_OR_STATIC}
$<TARGET_OBJECTS:MagnumMathObjects> $<TARGET_OBJECTS:MagnumMathObjects>
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_PROPERTY:Magnum,INTERFACE_INCLUDE_DIRECTORIES>) target_include_directories(MagnumMathTestLib PUBLIC $<TARGET_PROPERTY:Magnum,INTERFACE_INCLUDE_DIRECTORIES>)
target_compile_definitions(MagnumMathTestLib PRIVATE "CORRADE_GRACEFUL_ASSERT") target_compile_definitions(MagnumMathTestLib PRIVATE "CORRADE_GRACEFUL_ASSERT")
set_target_properties(MagnumMathTestLib PROPERTIES DEBUG_POSTFIX "-d") set_target_properties(MagnumMathTestLib PROPERTIES DEBUG_POSTFIX "-d")

4
src/Magnum/Platform/CMakeLists.txt

@ -578,7 +578,9 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT)
# Also create proper static library, if requested # Also create proper static library, if requested
if(WITH_EGLCONTEXT) if(WITH_EGLCONTEXT)
add_library(MagnumEglContext STATIC $<TARGET_OBJECTS:MagnumEglContextObjects>) add_library(MagnumEglContext STATIC
$<TARGET_OBJECTS:MagnumEglContextObjects>
dummy.cpp) # XCode workaround, see file comment for details
set_target_properties(MagnumEglContext PROPERTIES DEBUG_POSTFIX "-d") set_target_properties(MagnumEglContext PROPERTIES DEBUG_POSTFIX "-d")
if(BUILD_STATIC_PIC) if(BUILD_STATIC_PIC)
set_target_properties(MagnumEglContext PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(MagnumEglContext PROPERTIES POSITION_INDEPENDENT_CODE ON)

4
src/Magnum/Math/dummy.cpp → src/Magnum/dummy.cpp

@ -26,5 +26,5 @@
/* XCode-generated project files have a limitation that you can't create a /* 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 library target from OBJECT sources only and you have to provide at least one
file. Otherwise the generated library gets replaced with self-pointing file. Otherwise the generated library gets replaced with self-pointing
symlink and the build then obviously fails with "File not found" error. That symlink and the build then obviously fails with "File not found" error.
affected the MagnumMathTestLib library and this file should fix it. */ Related: http://public.kitware.com/pipermail/cmake/2016-April/063178.html */
Loading…
Cancel
Save