Added ability to build without thread_local support

https://forum.zdoom.org/viewtopic.php?t=58043
This commit is contained in:
alexey.lysiuk 2018-03-09 12:53:41 +02:00
parent 1d28a7f8e0
commit f5d5430804

View file

@ -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 )