if (CMAKE_USE_PTHREADS_INIT)
set(SRC ${SRC} pthread_start.c pthread_support.c pthread_stop_world.c)
# Common defines for most POSIX platforms.
- if (HOST MATCHES .*-.*-aix.*|.*-.*-android.*|.*-.*-cygwin.*|.*-.*-darwin.*|.*-.*-.*freebsd.*|.*-.*-haiku.*|.*-.*-gnu.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-.*linux.*|.*-.*-msys.*|.*-.*-nacl.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*)
+ if (ANDROID OR APPLE OR CYGWIN OR MSYS OR HOST MATCHES .*-.*-aix.*|.*-.*-.*freebsd.*|.*-.*-haiku.*|.*-.*-gnu.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-.*linux.*|.*-.*-nacl.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*)
add_definitions("-DGC_THREADS -D_REENTRANT")
if (enable_parallel_mark)
add_definitions("-DPARALLEL_MARK")
message("Only on NetBSD 2.0 or later.")
add_definitions("-D_PTHREADS")
endif()
- if (HOST MATCHES .*-.*-android.*)
+ if (ANDROID) # ANDROID variable is defined by CMake v3.7.0+.
# Android NDK does not provide pthread_atfork.
- elseif (HOST MATCHES .*-.*-aix.*|.*-.*-cygwin.*|.*-.*-freebsd.*|.*-.*-haiku.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-kfreebsd.*-gnu|.*-.*-.*linux.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*)
+ elseif (CYGWIN OR HOST MATCHES .*-.*-aix.*|.*-.*-freebsd.*|.*-.*-haiku.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-kfreebsd.*-gnu|.*-.*-.*linux.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*)
if (enable_handle_fork)
add_definitions("-DHANDLE_FORK")
endif(enable_handle_fork)
- endif()
- if (HOST MATCHES .*-.*-cygwin.*|.*-.*-msys.*)
- set(SRC ${SRC} win32_threads.c)
- endif()
- if (HOST MATCHES .*-.*-darwin.*)
+ elseif (APPLE)
if (enable_handle_fork)
# The incremental mode conflicts with fork handling.
if (enable_parallel_mark)
endif()
endif(enable_handle_fork)
set(SRC ${SRC} darwin_stop_world.c)
- #TODO darwin_threads=true
endif()
if (enable_sigrt_signals)
add_definitions("-DGC_USESIGRT_SIGNALS")
endif()
+ if (CYGWIN OR MSYS)
+ set(SRC ${SRC} win32_threads.c)
+ endif()
endif(CMAKE_USE_PTHREADS_INIT)
if (CMAKE_USE_WIN32_THREADS_INIT)