Skip to content

Commit

Permalink
Build: Link sdl2main when available
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelpro committed Jun 21, 2023
1 parent e05f742 commit 9618b4a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ if (SDL_SHARED OR SDL_STATIC)
list(APPEND CEN_TARGETS centurion)
target_link_libraries(centurion INTERFACE
centurion-headers-only
$<$<TARGET_EXISTS:SDL2::SDL2main>:SDL2::SDL2main>
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
$<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static>
$<IF:$<TARGET_EXISTS:SDL2_mixer::SDL2_mixer>,SDL2_mixer::SDL2_mixer,SDL2_mixer::SDL2_mixer-static>
Expand All @@ -70,6 +71,7 @@ if (SDL_STATIC)
list(APPEND CEN_TARGETS centurion-static)
target_link_libraries(centurion-static INTERFACE
centurion-headers-only
$<$<TARGET_EXISTS:SDL2::SDL2main>:SDL2::SDL2main>
SDL2::SDL2-static
SDL2_image::SDL2_image-static
SDL2_mixer::SDL2_mixer-static
Expand Down

0 comments on commit 9618b4a

Please sign in to comment.