Skip to content

Commit

Permalink
Always provide a target 'SDL2'
Browse files Browse the repository at this point in the history
  • Loading branch information
res2k committed Apr 17, 2024
1 parent 74467db commit cc2eaef
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ endif()
if (IS_64_BIT)
if (USE_SYSTEM_SDL2)
find_package(SDL2 REQUIRED)
else()

add_library(SDL2 INTERFACE IMPORTED GLOBAL)
target_link_libraries(SDL2 INTERFACE SDL2::SDL2)
else()
option(SDL_SHARED "" OFF)
option(SDL_STATIC "" ON)
option(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
Expand All @@ -64,7 +67,10 @@ if (IS_64_BIT)
set_target_properties(SDL2-static PROPERTIES FOLDER extern)
set_target_properties(uninstall PROPERTIES FOLDER extern)
set_target_properties(sdl_headers_copy PROPERTIES FOLDER extern)
endif()

add_library(SDL2 INTERFACE IMPORTED GLOBAL)
target_link_libraries(SDL2 INTERFACE SDL2main SDL2-static)
endif()
endif()

#
Expand Down

0 comments on commit cc2eaef

Please sign in to comment.