Reapply SDL2 modifications

The prevents Windows builds from leaking SDL2's exports
This commit is contained in:
Clownacy 2019-08-01 13:37:12 +00:00
parent ff61c099df
commit b56a49a1d5
2 changed files with 3 additions and 0 deletions

View file

@ -1843,6 +1843,7 @@ endif()
if(SDL_STATIC) if(SDL_STATIC)
set (BUILD_SHARED_LIBS FALSE) set (BUILD_SHARED_LIBS FALSE)
add_library(SDL2-static STATIC ${SOURCE_FILES}) add_library(SDL2-static STATIC ${SOURCE_FILES})
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC)
if (NOT SDL_SHARED OR NOT WIN32) if (NOT SDL_SHARED OR NOT WIN32)
set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
# Note: Apparently, OUTPUT_NAME must really be unique; even when # Note: Apparently, OUTPUT_NAME must really be unique; even when

View file

@ -58,6 +58,8 @@
# else # else
# define DECLSPEC __declspec(dllimport) # define DECLSPEC __declspec(dllimport)
# endif # endif
# elif defined(SDL_STATIC)
# define DECLSPEC
# else # else
# define DECLSPEC __declspec(dllexport) # define DECLSPEC __declspec(dllexport)
# endif # endif