cmake: use generated SDL_config.h to build SDLmain static lib

Thanks to @toazz for the patch!

Fixes #4829.
This commit is contained in:
Ryan C. Gordon 2021-11-09 11:13:52 -05:00
parent 3a82e432f0
commit 8f63e9ff68
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 1 additions and 0 deletions

View File

@ -2630,6 +2630,7 @@ if(NOT WINDOWS_STORE)
add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) add_library(SDL2main STATIC ${SDLMAIN_SOURCES})
# alias target for in-tree builds # alias target for in-tree builds
add_library(SDL2::SDL2main ALIAS SDL2main) add_library(SDL2::SDL2main ALIAS SDL2main)
target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include")
target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>) target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>)
set(_INSTALL_LIBS "SDL2main") set(_INSTALL_LIBS "SDL2main")
if (NOT ANDROID) if (NOT ANDROID)