mirror of
https://github.com/bellard/quickjs.git
synced 2024-11-22 13:48:11 +08:00
Add CONFIG_NO_WORKER Makefile option
This option eliminates the dependency on the pthread library. This mode is already toggled on _WIN32 and/or EMSCRIPTEN is detected, here we just allow the user to toggle it at will at the top level. This slightly reduce the code size as well, and may allow compiling this library in some embedded contexts where pthread is not available or is broken.
This commit is contained in:
parent
6e2e68fd08
commit
fdc6ba3bec
3
Makefile
3
Makefile
@ -148,6 +148,9 @@ ifeq ($(shell $(CC) -o /dev/null compat/test-closefrom.c 2>/dev/null && echo 1),
|
||||
DEFINES+=-DHAVE_CLOSEFROM
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_NO_WORKER
|
||||
DEFINES+=-DCONFIG_NO_WORKER
|
||||
endif
|
||||
|
||||
CFLAGS+=$(DEFINES)
|
||||
CFLAGS_DEBUG=$(CFLAGS) -O0
|
||||
|
@ -64,7 +64,7 @@ typedef sig_t sighandler_t;
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#if !defined(_WIN32) && !defined(CONFIG_NO_WORKER)
|
||||
/* enable the os.Worker API. IT relies on POSIX threads */
|
||||
#define USE_WORKER
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user