diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index aa4c6e9..9f2e90c 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -26,6 +26,7 @@ add_subdirectory("physfs") if(NOT MM_HEADLESS) if(NOT EMSCRIPTEN) + # TODO: move into imgui and soload, since they are the one requireing this if(VCPKG_TARGET_TRIPLET) find_package(SDL2 CONFIG REQUIRED) else() # HACK: fix sdl find module diff --git a/external/imgui/CMakeLists.txt b/external/imgui/CMakeLists.txt index cf2a781..24ee33b 100644 --- a/external/imgui/CMakeLists.txt +++ b/external/imgui/CMakeLists.txt @@ -64,9 +64,9 @@ elseif(VCPKG_TARGET_TRIPLET) target_link_libraries(imgui PUBLIC SDL2::SDL2 - PRIVATE - SDL2::SDL2main - SDL2::SDL2-static + #PRIVATE + #SDL2::SDL2main + #SDL2::SDL2-static ) else() target_include_directories(imgui PUBLIC "${SDL2_INCLUDE_DIR}") diff --git a/external/soloud/CMakeLists.txt b/external/soloud/CMakeLists.txt index 1ecf903..1ba52c9 100644 --- a/external/soloud/CMakeLists.txt +++ b/external/soloud/CMakeLists.txt @@ -161,28 +161,27 @@ target_compile_definitions(soloud PRIVATE WITH_SDL2_STATIC) target_include_directories(soloud SYSTEM PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/soloud/include") -#if not android or emscripten -if(VCPKG_TARGET_TRIPLET) +if(EMSCRIPTEN) + target_compile_options(soloud PUBLIC -sUSE_SDL=2) + target_link_libraries(soloud PUBLIC -sUSE_SDL=2) +elseif(VCPKG_TARGET_TRIPLET) target_link_libraries(soloud PUBLIC SDL2::SDL2 - PRIVATE - SDL2::SDL2main - SDL2::SDL2-static + #PRIVATE + #SDL2::SDL2main + #SDL2::SDL2-static ) else() target_include_directories(soloud PUBLIC "${SDL2_INCLUDE_DIR}") target_link_libraries(soloud PUBLIC ${SDL2_LIBRARY}) endif() +#if not android or emscripten #if android #target_link_libraries(soloud SDL) #endif -if(EMSCRIPTEN) - target_compile_options(soloud PUBLIC -sUSE_SDL=2) - target_link_libraries(soloud PUBLIC -sUSE_SDL=2) -endif() # TODO: remove diff --git a/framework/filesystem/CMakeLists.txt b/framework/filesystem/CMakeLists.txt index 1697d54..a57ac21 100644 --- a/framework/filesystem/CMakeLists.txt +++ b/framework/filesystem/CMakeLists.txt @@ -33,15 +33,18 @@ if(NOT MM_HEADLESS) target_compile_options(filesystem_service PUBLIC -sUSE_SDL=2) target_link_libraries(filesystem_service PUBLIC -sUSE_SDL=2) elseif(VCPKG_TARGET_TRIPLET) + find_package(SDL2 CONFIG REQUIRED) + target_link_libraries(filesystem_service PUBLIC SDL2::SDL2 - PRIVATE - SDL2::SDL2main - SDL2::SDL2-static + #PRIVATE + #SDL2::SDL2main + #SDL2::SDL2-static ) else() #if not android or emscripten + find_package(SDL2 REQUIRED) target_include_directories(filesystem_service PUBLIC "${SDL2_INCLUDE_DIR}") target_link_libraries(filesystem_service PUBLIC ${SDL2_LIBRARY}) #endif diff --git a/framework/sdl_service/CMakeLists.txt b/framework/sdl_service/CMakeLists.txt index 2640b33..0095ad1 100644 --- a/framework/sdl_service/CMakeLists.txt +++ b/framework/sdl_service/CMakeLists.txt @@ -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()