From f5d5430804da052d75535b39c88feb32766dfb41 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 9 Mar 2018 12:53:41 +0200 Subject: [PATCH] Added ability to build without thread_local support https://forum.zdoom.org/viewtopic.php?t=58043 --- src/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 )