mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 01:24:08 +00:00
Enable thread_local code more broadly.
This was only being enabled on Windows, Linux, and FreeBSD. (FreeBSD only had it enabled in the legacy build system, not in cmake.) `thread_local` is part of C++11, so now that we require C++17 or later and more recent compilers, this should work everywhere that threading does, so only disable it within a `SINGLE_THREAD` build.
This commit is contained in:
parent
82d853e5f8
commit
9a99c78ffb
|
@ -188,9 +188,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
message(STATUS "Platform: Linux")
|
message(STATUS "Platform: Linux")
|
||||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_LINUX_")
|
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_LINUX_")
|
||||||
if (TARGET_ARCHITECTURE STREQUAL "x86_64")
|
|
||||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_USE_THREAD_LOCAL")
|
|
||||||
endif()
|
|
||||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Android")
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||||
message(STATUS "Platform: Android")
|
message(STATUS "Platform: Android")
|
||||||
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_ANDROID_")
|
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_ANDROID_")
|
||||||
|
|
|
@ -2640,8 +2640,6 @@ def mk_config():
|
||||||
if is64():
|
if is64():
|
||||||
if not sysname.startswith('CYGWIN') and not sysname.startswith('MSYS') and not sysname.startswith('MINGW'):
|
if not sysname.startswith('CYGWIN') and not sysname.startswith('MSYS') and not sysname.startswith('MINGW'):
|
||||||
CXXFLAGS = '%s -fPIC' % CXXFLAGS
|
CXXFLAGS = '%s -fPIC' % CXXFLAGS
|
||||||
if sysname == 'Linux' or sysname == 'FreeBSD':
|
|
||||||
CPPFLAGS = '%s -D_USE_THREAD_LOCAL' % CPPFLAGS
|
|
||||||
elif not LINUX_X64:
|
elif not LINUX_X64:
|
||||||
CXXFLAGS = '%s -m32' % CXXFLAGS
|
CXXFLAGS = '%s -m32' % CXXFLAGS
|
||||||
LDFLAGS = '%s -m32' % LDFLAGS
|
LDFLAGS = '%s -m32' % LDFLAGS
|
||||||
|
|
|
@ -215,7 +215,7 @@ void * memory::allocate(char const* file, int line, char const* obj, size_t s) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SINGLE_THREAD) && (defined(_WINDOWS) || defined(_USE_THREAD_LOCAL))
|
#if !defined(SINGLE_THREAD)
|
||||||
// ==================================
|
// ==================================
|
||||||
// ==================================
|
// ==================================
|
||||||
// THREAD LOCAL VERSION
|
// THREAD LOCAL VERSION
|
||||||
|
|
Loading…
Reference in a new issue