From 8ba96cb32a2920487ac43f86ac007bbfb3a1dbdf Mon Sep 17 00:00:00 2001 From: Joe Osborn <joe.osborn@mac.com> Date: Sat, 22 Mar 2025 16:34:25 -0700 Subject: [PATCH] Fixes to libretro makefile for emscripten builds (#878) * Fixes to libretro makefile for emscripten builds * Include default 0 for pthread * update flags to support both threaded and non-threaded cases --- Makefile.libretro | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 2197946c..d04f0b86 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -618,12 +618,29 @@ else ifeq ($(platform), miyoo) # Emscripten else ifeq ($(platform), emscripten) TARGET := $(TARGET_NAME)_libretro_$(platform).bc + pthread ?= 0 fpic := -fPIC NO_MMAP = 1 + # we can use -lz for emscripten's built-in zlib port + WANT_ZLIB=0 CFLAGS += -DNO_DYLIB -DNO_SOCKET CFLAGS += -msimd128 -ftree-vectorize - LIBPTHREAD := - NO_PTHREAD=1 + # when compiling with pthreads... + ifneq ($(pthread), 0) + # use -lpthread + LIBPTHREAD := -lpthread + NO_PTHREAD=0 + # but we don't want to include libretro-common's rthread object files here + USE_RTHREADS=0 + USE_ASYNC_CDROM=0 + # so we disable some uses of threads within pcsx_rearmed. + # is this a good solution? I don't know! + else + LIBPTHREAD := + USE_RTHREADS=0 + USE_ASYNC_CDROM=0 + NO_PTHREAD=1 + endif DYNAREC = STATIC_LINKING = 1 HAVE_PHYSICAL_CDROM = 0 -- 2.39.5