diff options
author | Markus Minichmayr <markus@tapkey.com> | 2022-10-10 19:01:06 +0200 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2022-11-22 05:12:15 -0500 |
commit | 108c485248f28557cd864dd13da9acd510758620 (patch) | |
tree | 761bfde85219d24452fc2151a652a87bea5b68e0 /CMakeLists.txt | |
parent | 2fdae45ec8f231bb418238f20556da2ad54d9d17 (diff) | |
download | libical-git-108c485248f28557cd864dd13da9acd510758620.tar.gz |
CMAKE option LIBICAL_SYNC_MODE_THREADLOCAL: Allow compiling all global variables with thread-local storage, thus avoiding the need for synchronization.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f5d5e52c..c568dd0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,13 @@ # Build with the undefined sanitizer (requires gcc or clang) # Default=false # +# -DLIBICAL_SYNCMODE_THREADLOCAL=[true|false] +# Experimental: If set to true, global variables are marked as thread-local. This allows accessing +# libical from multiple threads without the need for synchronization. However, any global settings +# must be applied per thread. +# If set to false, the default synchronization mechanism is applied. That is, if the pthreads library +# is available, it will be used, otherwise no synchronization is applied. +# Default: false. cmake_minimum_required(VERSION 3.11.0) #first line, to shutup a cygwin warning project(libical C) #CXX is optional for the bindings @@ -736,6 +743,9 @@ if(LIBICAL_DEVMODE_UNDEFINED_SANITIZER) endif() endif() +mark_as_advanced(LIBICAL_SYNCMODE_THREADLOCAL) +libical_option(LIBICAL_SYNCMODE_THREADLOCAL "Experimental: Mark global variables as thread-local." False) + libical_option(ENABLE_LTO_BUILD "Build a link-time optimized version." False) if(ENABLE_LTO_BUILD) if(CMAKE_C_COMPILER_IS_GCC) |