mkxp-z/subprojects/packagefiles/openal-soft-emscripten-pthread.patch
刘皓 ecd8e50e9e
Upgrade OpenAL Soft from 1.23.1 to 1.24.2 again in libretro builds
I don't know why the Wii U build fails with older versions of OpenAL
Soft. There's nothing we can do here except use the newer OpenAL Soft
versions.
2025-04-09 17:22:13 -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
@@ -561,7 +561,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)