diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1ded86fb8d..9248964391 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -403,6 +403,16 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) endif() endif() +# Check for thread_local keyword, it's optional at the moment + +CHECK_CXX_SOURCE_COMPILES("thread_local int i; int main() { i = 0; }" + HAVE_THREAD_LOCAL) + +if( NOT HAVE_THREAD_LOCAL ) + message( WARNING "C++ compiler doesn't support thread_local storage duration specifier" ) + add_definitions( -Dthread_local= ) +endif() + # Check for functions that may or may not exist. CHECK_FUNCTION_EXISTS( filelength FILELENGTH_EXISTS )