Skip to content

Commit

Permalink
Try to add missing SDL_revision.h and SDL_config.h headers
Browse files Browse the repository at this point in the history
  • Loading branch information
o01eg committed Dec 23, 2024
1 parent d93ab70 commit 5289a77
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ index 1bc7ffb..5bc532e 100644

if(SDL_SHARED)
- add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
+ add_library(SDL2 SHARED ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SOURCE_FILES} ${VERSION_SOURCES})
+ add_library(SDL2 SHARED ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL_config.h ${SOURCE_FILES} ${VERSION_SOURCES})
add_dependencies(SDL2 sdl_headers_copy)
# alias target for in-tree builds
add_library(SDL2::SDL2 ALIAS SDL2)
Expand All @@ -25,7 +25,7 @@ index 1bc7ffb..5bc532e 100644
endif()
if(APPLE)
+ set_target_properties(SDL2 PROPERTIES
+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS}")
+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL_config.h")
# FIXME: Remove SOVERSION in SDL3
set_target_properties(SDL2 PROPERTIES
MACOSX_RPATH 1
Expand All @@ -34,15 +34,15 @@ index 1bc7ffb..5bc532e 100644

if(SDL_STATIC)
- add_library(SDL2-static STATIC ${SOURCE_FILES})
+ add_library(SDL2-static STATIC ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SOURCE_FILES})
+ add_library(SDL2-static STATIC ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL_config.h ${SOURCE_FILES})
add_dependencies(SDL2-static sdl_headers_copy)
# alias target for in-tree builds
add_library(SDL2::SDL2-static ALIAS SDL2-static)
set_target_properties(SDL2-static PROPERTIES
OUTPUT_NAME "${sdl_static_libname}"
POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}")
+ set_target_properties(SDL2-static PROPERTIES
+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS}")
+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>/SDL_config.h")
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB)
# TODO: Win32 platforms keep the same suffix .lib for import and static
# libraries - do we need to consider this?
Expand Down

0 comments on commit 5289a77

Please sign in to comment.