Support enable_sigrt_signals option by CMake script
authorIvan Maidanski <ivmai@mail.ru>
Tue, 4 Jun 2019 20:20:43 +0000 (23:20 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 5 Jun 2019 06:40:29 +0000 (09:40 +0300)
Issue #281 (bdwgc).

* CMakeLists.txt (enable_sigrt_signals): Add option (default to OFF).
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && enable_sigrt_signals]:
Define GC_USESIGRT_SIGNALS macro.

CMakeLists.txt

index 4c78b6a..4fac59d 100644 (file)
@@ -33,6 +33,7 @@ option(enable_thread_local_alloc "Turn on thread-local allocation optimization"
 option(enable_threads_discovery "Enable threads discovery in GC" ON)
 #TODO Support OPTION(enable_cplusplus "install C++ support" OFF)
 option(enable_gcj_support "Support for gcj" ON)
+option(enable_sigrt_signals "Use SIGRTMIN-based signals for thread suspend/resume" OFF)
 option(enable_gc_debug "Support for pointer back-tracing" OFF)
 option(enable_java_finalization "Support for java finalization" ON)
 option(enable_atomic_uncollectable "Support for atomic uncollectible allocation" ON)
@@ -141,6 +142,9 @@ if (CMAKE_USE_PTHREADS_INIT)
     set(SRC ${SRC} darwin_stop_world.c)
     #TODO darwin_threads=true
   endif()
+  if (enable_sigrt_signals)
+    add_definitions("-DGC_USESIGRT_SIGNALS")
+  endif()
 endif(CMAKE_USE_PTHREADS_INIT)
 
 if (CMAKE_USE_WIN32_THREADS_INIT)