mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-06-19 19:26:36 +02:00
better cmake for emscripten flags
This commit is contained in:
16
external/soloud/CMakeLists.txt
vendored
16
external/soloud/CMakeLists.txt
vendored
@ -163,10 +163,16 @@ target_include_directories(soloud SYSTEM PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/sol
|
||||
|
||||
#if not android or emscripten
|
||||
if(VCPKG_TARGET_TRIPLET)
|
||||
target_link_libraries(soloud SDL2::SDL2 SDL2::SDL2main SDL2::SDL2-static)
|
||||
target_link_libraries(soloud
|
||||
PUBLIC
|
||||
SDL2::SDL2
|
||||
PRIVATE
|
||||
SDL2::SDL2main
|
||||
SDL2::SDL2-static
|
||||
)
|
||||
else()
|
||||
target_include_directories(soloud PUBLIC "${SDL2_INCLUDE_DIR}")
|
||||
target_link_libraries(soloud ${SDL2_LIBRARY})
|
||||
target_link_libraries(soloud PUBLIC ${SDL2_LIBRARY})
|
||||
endif()
|
||||
|
||||
#if android
|
||||
@ -174,14 +180,14 @@ endif()
|
||||
#endif
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
set_target_properties(soloud PROPERTIES COMPILE_FLAGS "-s USE_SDL=2")
|
||||
set_target_properties(soloud PROPERTIES LINK_FLAGS "-s USE_SDL=2")
|
||||
target_compile_options(soloud PUBLIC -sUSE_SDL=2)
|
||||
target_link_libraries(soloud PUBLIC -sUSE_SDL=2)
|
||||
endif()
|
||||
|
||||
|
||||
# TODO: remove
|
||||
if(UNIX)
|
||||
target_link_libraries(soloud
|
||||
target_link_libraries(soloud PUBLIC
|
||||
-ldl
|
||||
)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user