diff options
-rw-r--r-- | ConfigureChecks.cmake | 15 | ||||
-rw-r--r-- | config.h.cmake | 6 |
2 files changed, 21 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) diff --git a/config.h.cmake b/config.h.cmake index 1550ff9..3c47a7d 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -117,6 +117,12 @@ /**************************** OPTIONS ****************************/ +/* Check if we have TLS support with GCC */ +#cmakedefine HAVE_GCC_THREAD_LOCAL_STORAGE 1 + +/* Check if we have TLS support with MSVC */ +#cmakedefine HAVE_MSVC_THREAD_LOCAL_STORAGE 1 + /*************************** ENDIAN *****************************/ #cmakedefine WORDS_SIZEOF_VOID_P ${WORDS_SIZEOF_VOID_P} |