Enable multi-threaded builds by CMake
authorIvan Maidanski <ivmai@mail.ru>
Thu, 22 Aug 2019 22:14:25 +0000 (01:14 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 22 Aug 2019 22:14:25 +0000 (01:14 +0300)
commit54769e69e4c74450cd7cd1e06a9c57fa43f4f7ee
treebe1b18414fdb3b2f236acbf741bd1d2ead167ce5
parent4ed4d8945ad19d1470b8d3aa09e2ee4dfeeacea2
Enable multi-threaded builds by CMake

Now, enable_threads option is on by default.

* CMakeLists.txt (enable_threads): Change option default to ON; remove
TODO item; set proper option message.
* CMakeLists.txt (libatomic_ops/src): Specify include directory only
if enable_threads.
* CMakeLists.txt (LIBS): Rename to THREADDLLIBS.
* CMakeLists.txt [enable_threads]: Change message level and content.
* CMakeLists.txt [enable_threads] (THREADDLLIBS): Set to
CMAKE_THREAD_LIBS_INIT value (instead of Threads_LIBRARIES).
* CMakeLists.txt [enable_threads && !(APPLE || CYGWIN || MSYS || WIN32
|| HOST MATCHES mips-.*-irix6.*)] (THREADDLLIBS): Append -ldl; add
comment.
* CMakeLists.txt [Threads_FOUND]: Remove commented out code.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT]: Update comments; remove
TODO items.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT
&& (HOST MATCHES .*-.*-hpux10.*)]: Change message level to fatal error.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT] (GC_BUILTIN_ATOMIC): Define
C macro; add comment.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT] (GC_THREADS, _REENTRANT):
Define C macro unconditionally.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && !ANDROID && !MSYS
&& !APPLE && enable_handle_fork] (HANDLE_FORK): Define C macro.
* CMakeLists.txt [CMAKE_USE_WIN32_THREADS_INIT
&& enable_thread_local_alloc && !enable_parallel_mark]
(THREAD_LOCAL_ALLOC): Do not define if BUILD_SHARED_LIBS; add comment.
* CMakeLists.txt [CMAKE_HP_PTHREADS_INIT || CMAKE_USE_SPROC_INIT]:
Fatal error message.
* CMakeLists.txt [enable_gcj_support && enable_threads]
(GC_ENABLE_SUSPEND_THREAD): Do not define if enable_thread_local_alloc
and host is kfreebsd; add FIXME item.
* CMakeLists.txt [enable_threads] (gc): Specify THREADDLLIBS as target
link libraries.
* CMakeLists.txt [build_tests] (gctest): Likewise.
* CMakeLists.txt [build_tests && enable_disclaim] (disclaim_test,
disclaim_weakmap_test): Likewise.
* CMakeLists.txt [build_tests && enable_threads] (test_atomic_ops,
threadleaktest, subthreadcreate_test, initsecondarythread_test):
Specify test executable.
* CMakeLists.txt [build_tests && enable_threads && !WIN32]
(threadkey_test): Likewise.
CMakeLists.txt