@@ -26,6 +26,7 @@ class LibError(Exception):
26
26
SRC_DIR = SRC_DIR_LOCAL if os .path .exists (SRC_DIR_LOCAL ) else SRC_DIR_REPO
27
27
28
28
IS_SINGLE_THREADED = False
29
+ ENABLE_LTO = True
29
30
30
31
IS_PYODIDE = 'PYODIDE_ROOT' in os .environ and os .environ .get ('_PYTHON_HOST_PLATFORM' , '' ).startswith ('emscripten' )
31
32
@@ -43,6 +44,7 @@ class LibError(Exception):
43
44
build_env ['CXXFLAGS' ] = build_env .get ('CXXFLAGS' , '' ) + " -fexceptions"
44
45
build_env ['LDFLAGS' ] = build_env .get ('LDFLAGS' , '' ) + " -fexceptions"
45
46
IS_SINGLE_THREADED = True
47
+ ENABLE_LTO = False
46
48
# build with pthread doesn't work. The WASM bindings are also single threaded.
47
49
48
50
else :
@@ -122,6 +124,7 @@ def _z3_version():
122
124
123
125
def _configure_z3 ():
124
126
global IS_SINGLE_THREADED
127
+ global ENABLE_LTO
125
128
# bail out early if we don't need to do this - it forces a rebuild every time otherwise
126
129
if os .path .exists (BUILD_DIR ):
127
130
return
@@ -136,7 +139,7 @@ def _configure_z3():
136
139
'CMAKE_BUILD_TYPE' : 'Release' ,
137
140
'Z3_BUILD_EXECUTABLE' : True ,
138
141
'Z3_BUILD_LIBZ3_SHARED' : True ,
139
- 'Z3_LINK_TIME_OPTIMIZATION' : True ,
142
+ 'Z3_LINK_TIME_OPTIMIZATION' : ENABLELTO ,
140
143
'WARNINGS_AS_ERRORS' : 'SERIOUS_ONLY' ,
141
144
# Disable Unwanted Options
142
145
'Z3_USE_LIB_GMP' : False , # Is default false in python build
0 commit comments