From 45369fffd065d394edf8d7160a463a10a91acc8e Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 21 Jul 2021 08:33:06 +0200 Subject: [PATCH] add DLL_EXPORT for shared libs --- recipes/sdl2_image/2.0.5/CMakeLists.txt | 4 ++++ recipes/sdl2_mixer/2.0.4/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/recipes/sdl2_image/2.0.5/CMakeLists.txt b/recipes/sdl2_image/2.0.5/CMakeLists.txt index 14b66f77..0d90df8a 100644 --- a/recipes/sdl2_image/2.0.5/CMakeLists.txt +++ b/recipes/sdl2_image/2.0.5/CMakeLists.txt @@ -92,6 +92,10 @@ endif() set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER source_subfolder/SDL_image.h) +if(${BUILD_SHARED_LIBS}) + target_compile_definitions(${PROJECT_NAME} PRIVATE DLL_EXPORT) +endif() + install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION "lib" LIBRARY DESTINATION "lib" diff --git a/recipes/sdl2_mixer/2.0.4/CMakeLists.txt b/recipes/sdl2_mixer/2.0.4/CMakeLists.txt index d9880bd8..17bf3043 100644 --- a/recipes/sdl2_mixer/2.0.4/CMakeLists.txt +++ b/recipes/sdl2_mixer/2.0.4/CMakeLists.txt @@ -100,6 +100,10 @@ endif() target_link_libraries(${PROJECT_NAME} PRIVATE ${CONAN_LIBS}) set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER source_subfolder/SDL_mixer.h) +if(${BUILD_SHARED_LIBS}) + target_compile_definitions(${PROJECT_NAME} PRIVATE DLL_EXPORT) +endif() + install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION "lib" LIBRARY DESTINATION "lib"