summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-11-29 23:14:30 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-11-30 11:16:48 +0300
commit6ccda3052c1f832629949ac7ffccd3e7a238dabb (patch)
tree6cfe95ac6cad57ca0040788987622f6a5410feb3 /CMakeLists.txt
parent910a23c621d8e8ed6a544ba2eb3eb6cd2198a109 (diff)
downloadbdwgc-6ccda3052c1f832629949ac7ffccd3e7a238dabb.tar.gz
Do not compile pthread_start.c, pthread_stop_world.c on Darwin (CMake)
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && APPLE] (SRC): Do not add pthread_start.c and pthread_stop_world.c; add darwin_stop_world.c before pthread_support.c item. * CMakeLists.txt [(enable_single_obj_compilation || BUILD_SHARED_LIBS) && CMAKE_USE_PTHREADS_INIT] (GC_PTHREAD_START_STANDALONE): Do not define C macro if APPLE.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f8fde9f..192a781c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -180,6 +180,8 @@ if (CMAKE_USE_PTHREADS_INIT)
set(SRC ${SRC} gc_dlopen.c)
if (CYGWIN OR MSYS)
set(SRC ${SRC} win32_threads.c)
+ elseif (APPLE)
+ set(SRC ${SRC} darwin_stop_world.c pthread_support.c)
else()
set(SRC ${SRC} pthread_start.c pthread_stop_world.c pthread_support.c)
endif()
@@ -208,7 +210,6 @@ if (CMAKE_USE_PTHREADS_INIT)
elseif (APPLE)
# The incremental mode conflicts with fork handling (for now).
# Thus, HANDLE_FORK is not defined.
- set(SRC ${SRC} darwin_stop_world.c)
elseif (enable_handle_fork AND NOT disable_handle_fork)
add_definitions("-DHANDLE_FORK")
endif()
@@ -342,7 +343,7 @@ endif(enable_werror)
if (enable_single_obj_compilation OR BUILD_SHARED_LIBS)
set(SRC extra/gc.c) # override SRC
- if (CMAKE_USE_PTHREADS_INIT AND NOT (CYGWIN OR MSYS))
+ if (CMAKE_USE_PTHREADS_INIT AND NOT (APPLE OR CYGWIN OR MSYS))
add_definitions("-DGC_PTHREAD_START_STANDALONE")
set(SRC ${SRC} pthread_start.c)
endif()