Skip to content

Commit e258411

Browse files
authored
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
1 parent b53685f commit e258411

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Makefile.libretro

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,12 +618,29 @@ else ifeq ($(platform), miyoo)
618618
# Emscripten
619619
else ifeq ($(platform), emscripten)
620620
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
621+
pthread ?= 0
621622
fpic := -fPIC
622623
NO_MMAP = 1
624+
# we can use -lz for emscripten's built-in zlib port
625+
WANT_ZLIB=0
623626
CFLAGS += -DNO_DYLIB -DNO_SOCKET
624627
CFLAGS += -msimd128 -ftree-vectorize
625-
LIBPTHREAD :=
626-
NO_PTHREAD=1
628+
# when compiling with pthreads...
629+
ifneq ($(pthread), 0)
630+
# use -lpthread
631+
LIBPTHREAD := -lpthread
632+
NO_PTHREAD=0
633+
# but we don't want to include libretro-common's rthread object files here
634+
USE_RTHREADS=0
635+
USE_ASYNC_CDROM=0
636+
# so we disable some uses of threads within pcsx_rearmed.
637+
# is this a good solution? I don't know!
638+
else
639+
LIBPTHREAD :=
640+
USE_RTHREADS=0
641+
USE_ASYNC_CDROM=0
642+
NO_PTHREAD=1
643+
endif
627644
DYNAREC =
628645
STATIC_LINKING = 1
629646
HAVE_PHYSICAL_CDROM = 0

0 commit comments

Comments
 (0)