Browse Source

TgaImageConverter, TgaImporter: fix linking of tests on Windows.

Dllimport hell at its finest.
pull/88/head
Vladimír Vondruš 11 years ago
parent
commit
3ca8fe7e6c
  1. 8
      src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt
  2. 7
      src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt

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

@ -29,3 +29,11 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(TgaImageConverterTest TgaImageConverterTest.cpp LIBRARIES MagnumTgaImageConverterTestLib MagnumTgaImporterTestLib) corrade_add_test(TgaImageConverterTest TgaImageConverterTest.cpp LIBRARIES MagnumTgaImageConverterTestLib MagnumTgaImporterTestLib)
# On Win32 we need to avoid dllimporting TgaImporter and TgaImageConverterTest
# 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)
set_target_properties(TgaImageConverterTest PROPERTIES COMPILE_FLAGS
"-DMAGNUM_TGAIMAGECONVERTER_BUILD_STATIC -DMAGNUM_TGAIMPORTER_BUILD_STATIC")
endif()

7
src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt

@ -29,3 +29,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(TgaImporterTest TgaImporterTest.cpp LIBRARIES MagnumTgaImporterTestLib) corrade_add_test(TgaImporterTest TgaImporterTest.cpp LIBRARIES MagnumTgaImporterTestLib)
# 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)
set_target_properties(TgaImporterTest PROPERTIES COMPILE_FLAGS "-DMAGNUM_TGAIMPORTER_BUILD_STATIC")
endif()

Loading…
Cancel
Save