mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2024-12-04 19:23:28 +01:00
add mingw-w64 support
This commit is contained in:
parent
dc37ad54ec
commit
ec98df52d7
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,7 +10,7 @@ cmake-build-release/
|
||||
*.stackdump
|
||||
*.coredump
|
||||
compile_commands.json
|
||||
/build
|
||||
/build*
|
||||
.clangd
|
||||
.cache
|
||||
|
||||
|
4
external/CMakeLists.txt
vendored
4
external/CMakeLists.txt
vendored
@ -26,8 +26,12 @@ add_subdirectory("physfs")
|
||||
|
||||
if(NOT MM_HEADLESS)
|
||||
if(NOT EMSCRIPTEN)
|
||||
if(VCPKG_TARGET_TRIPLET)
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
else() # HACK: fix sdl find module
|
||||
find_package(SDL2 REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT MM_OPENGL_3_GLES)
|
||||
# opengl3 loader
|
||||
|
4
external/imgui/CMakeLists.txt
vendored
4
external/imgui/CMakeLists.txt
vendored
@ -58,7 +58,9 @@ if(EMSCRIPTEN)
|
||||
set_target_properties(imgui PROPERTIES LINK_FLAGS "-s USE_SDL=2 -s USE_WEBGL2=1 -s FULL_ES2=1 -s FULL_ES3=1")
|
||||
elseif(ANDROID)
|
||||
target_link_libraries(imgui SDL)
|
||||
else() # if not android or emscripten
|
||||
elseif(VCPKG_TARGET_TRIPLET)
|
||||
target_link_libraries(imgui SDL2::SDL2 SDL2::SDL2main SDL2::SDL2-static)
|
||||
else()
|
||||
target_include_directories(imgui PUBLIC "${SDL2_INCLUDE_DIR}")
|
||||
target_link_libraries(imgui ${SDL2_LIBRARY})
|
||||
endif()
|
||||
|
9
external/soloud/CMakeLists.txt
vendored
9
external/soloud/CMakeLists.txt
vendored
@ -163,9 +163,12 @@ target_include_directories(soloud SYSTEM PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/sol
|
||||
#target_include_directories(soloud PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/imgui")
|
||||
|
||||
#if not android or emscripten
|
||||
target_include_directories(soloud PUBLIC "${SDL2_INCLUDE_DIR}")
|
||||
target_link_libraries(soloud ${SDL2_LIBRARY})
|
||||
#endif
|
||||
if(VCPKG_TARGET_TRIPLET)
|
||||
target_link_libraries(soloud SDL2::SDL2 SDL2::SDL2main SDL2::SDL2-static)
|
||||
else()
|
||||
target_include_directories(soloud PUBLIC "${SDL2_INCLUDE_DIR}")
|
||||
target_link_libraries(soloud ${SDL2_LIBRARY})
|
||||
endif()
|
||||
|
||||
#if android
|
||||
#target_link_libraries(soloud SDL)
|
||||
|
7
external/tracy/CMakeLists.txt
vendored
7
external/tracy/CMakeLists.txt
vendored
@ -19,10 +19,11 @@ endif()
|
||||
|
||||
target_include_directories(tracy_client PUBLIC "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
#target_link_libraries(tracy_client
|
||||
#)
|
||||
|
||||
if(UNIX)
|
||||
target_link_libraries(tracy_client dl)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(tracy_client ws2_32 dbghelp)
|
||||
endif()
|
||||
|
||||
|
@ -31,6 +31,8 @@ if(NOT MM_HEADLESS)
|
||||
if(EMSCRIPTEN)
|
||||
set_target_properties(filesystem_service PROPERTIES COMPILE_FLAGS "-s USE_SDL=2")
|
||||
set_target_properties(filesystem_service PROPERTIES LINK_FLAGS "-s USE_SDL=2")
|
||||
elseif(VCPKG_TARGET_TRIPLET)
|
||||
target_link_libraries(filesystem_service SDL2::SDL2 SDL2::SDL2main SDL2::SDL2-static)
|
||||
else()
|
||||
#if not android or emscripten
|
||||
target_include_directories(filesystem_service PUBLIC "${SDL2_INCLUDE_DIR}")
|
||||
|
@ -39,6 +39,10 @@ else()
|
||||
target_link_libraries(sdl_service glad)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_TRIPLET)
|
||||
target_link_libraries(sdl_service SDL2::SDL2 SDL2::SDL2main SDL2::SDL2-static)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
@ -34,6 +34,9 @@ SDLService::SDLService(uint32_t _sdl_init_flags) {
|
||||
//#ifdef __EMSCRIPTEN__
|
||||
//_sdl_init_flags &= ~SDL_INIT_HAPTIC;
|
||||
//#endif
|
||||
#if 1 // hack for mingw + wine
|
||||
_sdl_init_flags &= ~SDL_INIT_SENSOR;
|
||||
#endif
|
||||
|
||||
sdl_init_flags = _sdl_init_flags;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user