From b56a49a1d590e4a1efac0ea93af08faee746daa2 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 1 Aug 2019 13:37:12 +0000 Subject: [PATCH] Reapply SDL2 modifications The prevents Windows builds from leaking SDL2's exports --- external/SDL2/CMakeLists.txt | 1 + external/SDL2/include/begin_code.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/external/SDL2/CMakeLists.txt b/external/SDL2/CMakeLists.txt index bd59d89b..4c0f6fd0 100644 --- a/external/SDL2/CMakeLists.txt +++ b/external/SDL2/CMakeLists.txt @@ -1843,6 +1843,7 @@ endif() if(SDL_STATIC) set (BUILD_SHARED_LIBS FALSE) add_library(SDL2-static STATIC ${SOURCE_FILES}) + target_compile_definitions(SDL2-static PRIVATE SDL_STATIC) if (NOT SDL_SHARED OR NOT WIN32) set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") # Note: Apparently, OUTPUT_NAME must really be unique; even when diff --git a/external/SDL2/include/begin_code.h b/external/SDL2/include/begin_code.h index 22c997c4..2846197e 100644 --- a/external/SDL2/include/begin_code.h +++ b/external/SDL2/include/begin_code.h @@ -58,6 +58,8 @@ # else # define DECLSPEC __declspec(dllimport) # endif +# elif defined(SDL_STATIC) +# define DECLSPEC # else # define DECLSPEC __declspec(dllexport) # endif