diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2014-09-11 17:07:50 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2015-02-08 09:41:04 +0100 |
commit | 0626feeed1c998159fb8c7c5a752836a543fb2c8 (patch) | |
tree | bbc28a83b777391bfa5789d68ca33604e9a8ee98 /ConfigureChecks.cmake | |
parent | 228974705c2860cfb0ae82460ce2ad8e642491a5 (diff) | |
download | cmocka-0626feeed1c998159fb8c7c5a752836a543fb2c8.tar.gz cmocka-0626feeed1c998159fb8c7c5a752836a543fb2c8.tar.xz cmocka-0626feeed1c998159fb8c7c5a752836a543fb2c8.zip |
cmake: Add configure checks for thread local storage.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 0d62529..5540b53 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -91,6 +91,21 @@ endif (WIN32) set(CMOCKA_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "cmocka required system libraries") # OPTIONS +check_c_source_compiles(" +__thread int tls; + +int main(void) { + return 0; +}" HAVE_GCC_THREAD_LOCAL_STORAGE) + +if (WIN32) +check_c_source_compiles(" +__declspec(thread) int tls; + +int main(void) { + return 0; +}" HAVE_MSVC_THREAD_LOCAL_STORAGE) +endif(WIN32) # ENDIAN if (NOT WIN32) |