mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-06-18 18:56:36 +02:00
fix cmake sdl finding, find_package for each cmake scope
This commit is contained in:
@ -27,8 +27,19 @@ target_link_libraries(sdl_service PUBLIC
|
||||
if(EMSCRIPTEN)
|
||||
target_compile_options(sdl_service PUBLIC -sUSE_SDL=2)
|
||||
target_link_libraries(sdl_service PUBLIC -sUSE_SDL=2)
|
||||
elseif(VCPKG_TARGET_TRIPLET)
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
|
||||
target_link_libraries(sdl_service
|
||||
PUBLIC
|
||||
SDL2::SDL2
|
||||
#PRIVATE
|
||||
#SDL2::SDL2main
|
||||
#SDL2::SDL2-static
|
||||
)
|
||||
else()
|
||||
#if not android or emscripten
|
||||
find_package(SDL2 REQUIRED)
|
||||
target_include_directories(sdl_service PUBLIC "${SDL2_INCLUDE_DIR}")
|
||||
target_link_libraries(sdl_service PUBLIC ${SDL2_LIBRARY})
|
||||
#endif
|
||||
@ -40,16 +51,6 @@ else()
|
||||
target_link_libraries(sdl_service PRIVATE glad)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_TRIPLET)
|
||||
target_link_libraries(sdl_service
|
||||
PUBLIC
|
||||
SDL2::SDL2
|
||||
PRIVATE
|
||||
SDL2::SDL2main
|
||||
SDL2::SDL2-static
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user