summaryrefslogtreecommitdiff
path: root/cmake/thread_local.cmake
diff options
context:
space:
mode:
authorThomas Moenicke <thomas.moenicke@mapbox.com>2019-06-11 16:06:16 +0300
committerThomas Moenicke <thomas.moenicke@mapbox.com>2019-06-25 18:10:40 +0300
commit0990a8c3e943dc5d000f6df185fea43ba137bf3c (patch)
tree264adfb70337afae06b9ba34a5011cb57706df12 /cmake/thread_local.cmake
parentbd481b1d60132c1b7f8ab1ebd8e363802907f9d5 (diff)
downloadqtlocation-mapboxgl-upstream/tmoenicke-remove-threadlocal.tar.gz
use C++11 thread_local, ThreadLocal class as a fallback when thread_local not supportedupstream/tmoenicke-remove-threadlocal
Diffstat (limited to 'cmake/thread_local.cmake')
-rw-r--r--cmake/thread_local.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/thread_local.cmake b/cmake/thread_local.cmake
new file mode 100644
index 0000000000..e0031d8439
--- /dev/null
+++ b/cmake/thread_local.cmake
@@ -0,0 +1,10 @@
+include(WriteCompilerDetectionHeader)
+
+write_compiler_detection_header(
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/compilerchecks/thread_local_compiler_detection.h"
+ PREFIX MB
+ COMPILERS GNU Clang AppleClang MSVC Intel
+ FEATURES cxx_thread_local
+)
+
+add_definitions(-DDETECT_THREAD_LOCAL)