@@ -25,6 +25,8 @@ class LibError(Exception):
25
25
SRC_DIR_REPO = os .path .join (ROOT_DIR , '..' , '..' , '..' )
26
26
SRC_DIR = SRC_DIR_LOCAL if os .path .exists (SRC_DIR_LOCAL ) else SRC_DIR_REPO
27
27
28
+ IS_SINGLE_THREADED = False
29
+
28
30
IS_PYODIDE = 'PYODIDE_ROOT' in os .environ and os .environ .get ('_PYTHON_HOST_PLATFORM' , '' ).startswith ('emscripten' )
29
31
30
32
# determine where binaries are
@@ -37,10 +39,12 @@ class LibError(Exception):
37
39
BUILD_PLATFORM = "emscripten"
38
40
BUILD_ARCH = "wasm32"
39
41
BUILD_OS_VERSION = os .environ ['_PYTHON_HOST_PLATFORM' ].split ('_' )[1 :- 1 ]
40
- build_env ['CFLAGS' ] = build_env .get ('CFLAGS' , '' ) + " -fexceptions -pthread"
41
- build_env ['CXXFLAGS' ] = build_env .get ('CXXFLAGS' , '' ) + " -fexceptions -pthread"
42
- build_env ['LDFLAGS' ] = build_env .get ('LDFLAGS' , '' ) + " -fexceptions -pthread"
43
-
42
+ build_env ['CFLAGS' ] = build_env .get ('CFLAGS' , '' ) + " -fexceptions"
43
+ build_env ['CXXFLAGS' ] = build_env .get ('CXXFLAGS' , '' ) + " -fexceptions"
44
+ build_env ['LDFLAGS' ] = build_env .get ('LDFLAGS' , '' ) + " -fexceptions"
45
+ IS_SINGLE_THREADED = True
46
+ # build with pthread doesn't work. The WASM bindings are also single threaded.
47
+
44
48
else :
45
49
BUILD_PLATFORM = sys .platform
46
50
BUILD_ARCH = os .environ .get ("Z3_CROSS_COMPILING" , platform .machine ())
@@ -117,6 +121,7 @@ def _z3_version():
117
121
return version + post
118
122
119
123
def _configure_z3 ():
124
+ global IS_SINGLE_THREADED
120
125
# bail out early if we don't need to do this - it forces a rebuild every time otherwise
121
126
if os .path .exists (BUILD_DIR ):
122
127
return
@@ -125,7 +130,7 @@ def _configure_z3():
125
130
# Config options
126
131
cmake_options = {
127
132
# Config Options
128
- 'Z3_SINGLE_THREADED' : False ,
133
+ 'Z3_SINGLE_THREADED' : IS_SINGLE_THREADED ,
129
134
'Z3_BUILD_PYTHON_BINDINGS' : True ,
130
135
# Build Options
131
136
'CMAKE_BUILD_TYPE' : 'Release' ,
0 commit comments