Browse Source

MagnumFont, MagnumFontConverter: fix linker errors in tests on Windows.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
2e5eddc83b
  1. 14
      src/MagnumPlugins/MagnumFont/CMakeLists.txt
  2. 14
      src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt
  3. 8
      src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt

14
src/MagnumPlugins/MagnumFont/CMakeLists.txt

@ -54,7 +54,19 @@ endif()
install(FILES ${MagnumFont_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFont) install(FILES ${MagnumFont_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFont)
if(BUILD_GL_TESTS) if(BUILD_GL_TESTS)
add_library(MagnumMagnumFontTestLib STATIC $<TARGET_OBJECTS:MagnumFontObjects>) # On Win32 we need to avoid dllimporting TgaImporter symbols, because it
# would search for the symbols in some DLL even when they were linked
# statically. However it apparently doesn't matter that they were
# dllexported when building the static library. EH.
if(WIN32)
add_library(MagnumMagnumFontTestLib STATIC
${MagnumFont_SRCS}
${MagnumFont_HEADERS})
set_target_properties(MagnumMagnumFontTestLib PROPERTIES COMPILE_FLAGS "-DMAGNUM_TGAIMPORTER_BUILD_STATIC")
else()
add_library(MagnumMagnumFontTestLib STATIC $<TARGET_OBJECTS:MagnumFontObjects>)
endif()
target_link_libraries(MagnumMagnumFontTestLib Magnum MagnumText MagnumTgaImporterTestLib) target_link_libraries(MagnumMagnumFontTestLib Magnum MagnumText MagnumTgaImporterTestLib)
add_subdirectory(Test) add_subdirectory(Test)
endif() endif()

14
src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt

@ -54,7 +54,19 @@ endif()
install(FILES ${MagnumFontConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFontConverter) install(FILES ${MagnumFontConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFontConverter)
if(BUILD_GL_TESTS) if(BUILD_GL_TESTS)
add_library(MagnumMagnumFontConverterTestLib STATIC $<TARGET_OBJECTS:MagnumFontConverterObjects>) # On Win32 we need to avoid dllimporting TgaImageConverter symbols, because
# it would search for the symbols in some DLL even when they were linked
# statically. However it apparently doesn't matter that they were
# dllexported when building the static library. EH.
if(WIN32)
add_library(MagnumMagnumFontConverterTestLib STATIC
${MagnumFontConverter_SRCS}
${MagnumFontConverter_HEADERS})
set_target_properties(MagnumMagnumFontConverterTestLib PROPERTIES COMPILE_FLAGS "-DMAGNUM_TGAIMAGECONVERTER_BUILD_STATIC")
else()
add_library(MagnumMagnumFontConverterTestLib STATIC $<TARGET_OBJECTS:MagnumFontConverterObjects>)
endif()
target_link_libraries(MagnumMagnumFontConverterTestLib Magnum MagnumText MagnumTgaImageConverterTestLib) target_link_libraries(MagnumMagnumFontConverterTestLib Magnum MagnumText MagnumTgaImageConverterTestLib)
add_subdirectory(Test) add_subdirectory(Test)
endif() endif()

8
src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt

@ -32,3 +32,11 @@ corrade_add_test(MagnumFontConverterGLTest MagnumFontConverterGLTest.cpp LIBRARI
MagnumMagnumFontConverterTestLib MagnumMagnumFontConverterTestLib
MagnumTgaImporterTestLib MagnumTgaImporterTestLib
${GL_TEST_LIBRARIES}) ${GL_TEST_LIBRARIES})
# On Win32 we need to avoid dllimporting TgaImporter symbols, because it would
# search for the symbols in some DLL even though they were linked statically.
# However it apparently doesn't matter that they were dllexported when building
# the static library. EH.
if(WIN32)
set_target_properties(MagnumFontConverterGLTest PROPERTIES COMPILE_FLAGS "-DMAGNUM_TGAIMPORTER_BUILD_STATIC")
endif()

Loading…
Cancel
Save