mkxp-z/subprojects/packagefiles/openal-soft-emscripten-pthread.patch
刘皓 74f4c0e714
Downgrade OpenAL Soft from 1.24.2 to 1.23.1 in libretro builds
OpenAL Soft 1.24 introduces a lot of code that doesn't work well with
the PlayStation 3 homebrew toolchain, and also the old version of the
Wii U homebrew toolchain currently used by the libretro buildbot.
Instead of maintaining a bunch of patches to get 1.24 to work on these
toolchains, I think it'd be easier to just use 1.23.
2025-04-08 14:27:20 -04:00

16 lines
735 B
Diff

# Stops OpenAL Soft's build system from unconditionally enabling the `-pthread` compiler flag when targeting Emscripten because it causes problems if the rest of mkxp-z isn't also building with pthread support.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -558,7 +558,10 @@ if(NOT WIN32)
message(FATAL_ERROR "PThreads is required for non-Windows builds!")
endif()
- check_c_compiler_flag(-pthread HAVE_PTHREAD)
+ string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_LOWER)
+ if(NOT SYSTEM_LOWER STREQUAL "emscripten")
+ check_c_compiler_flag(-pthread HAVE_PTHREAD)
+ endif()
if(HAVE_PTHREAD)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -pthread")
set(C_FLAGS ${C_FLAGS} -pthread)