Skip to content

Commit 1113084

Browse files
committed
cmake: Use static SDL3 only on Linux
1 parent c79a389 commit 1113084

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64")
1616
endif()
1717

1818
# Statically link SDL3 for Linux targets
19-
set(SDL_STATIC ON)
20-
2119
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
20+
set(SDL_STATIC ON)
2221
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2322
endif()
2423

@@ -198,10 +197,17 @@ target_include_directories(iris PRIVATE
198197
res
199198
)
200199

201-
target_link_libraries(iris PUBLIC
202-
tomlplusplus::tomlplusplus
203-
SDL3::SDL3-static
204-
)
200+
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
201+
target_link_libraries(iris PUBLIC
202+
tomlplusplus::tomlplusplus
203+
SDL3::SDL3-static
204+
)
205+
else()
206+
target_link_libraries(iris PUBLIC
207+
tomlplusplus::tomlplusplus
208+
SDL3::SDL3
209+
)
210+
endif()
205211

206212
set_target_properties(iris PROPERTIES
207213
# On macOS, make a proper .app bundle instead of a bare executable

0 commit comments

Comments
 (0)