3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +00:00

adapt for pyodide built

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2024-11-19 18:51:04 -08:00
parent 012fc1b72b
commit 10d9c81957
2 changed files with 7 additions and 4 deletions

View file

@ -43,9 +43,9 @@ jobs:
cd src/api/python cd src/api/python
CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CXXFLAG="${CXXFLAGS}" ~/env/bin/pyodide build --exports whole_archive CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CXXFLAG="${CXXFLAGS}" ~/env/bin/pyodide build --exports whole_archive
env: env:
CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -pthread -s USE_PTHREADS=1 -g2 -s SAFE_HEAP=0 -s PTHREAD_POOL_SIZE=0 -s PTHREAD_POOL_SIZE_STRICT=0" CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -pthread -s USE_PTHREADS=1 -g2 -s SAFE_HEAP=0 -s PTHREAD_POOL_SIZE=0 -s PTHREAD_POOL_SIZE_STRICT=0 -latomic"
LDFLAGS: "-fexceptions -s WASM_BIGINT -s -pthread -s USE_PTHREADS=1" LDFLAGS: "-fexceptions -s WASM_BIGINT -s -pthread -s USE_PTHREADS=1 -latomic"
CXXFLAGS: "-fexceptions -pthread -s USE_PTHREADS=1 -s DISABLE_EXCEPTION_CATCHING=0" CXXFLAGS: "-fexceptions -pthread -s USE_PTHREADS=1 -s DISABLE_EXCEPTION_CATCHING=0 -latomic"
- name: Setup env-pyodide - name: Setup env-pyodide
run: | run: |

View file

@ -26,6 +26,7 @@ SRC_DIR_REPO = os.path.join(ROOT_DIR, '..', '..', '..')
SRC_DIR = SRC_DIR_LOCAL if os.path.exists(SRC_DIR_LOCAL) else SRC_DIR_REPO SRC_DIR = SRC_DIR_LOCAL if os.path.exists(SRC_DIR_LOCAL) else SRC_DIR_REPO
IS_SINGLE_THREADED = False IS_SINGLE_THREADED = False
ENABLE_LTO = True
IS_PYODIDE = 'PYODIDE_ROOT' in os.environ and os.environ.get('_PYTHON_HOST_PLATFORM', '').startswith('emscripten') IS_PYODIDE = 'PYODIDE_ROOT' in os.environ and os.environ.get('_PYTHON_HOST_PLATFORM', '').startswith('emscripten')
@ -43,6 +44,7 @@ if RELEASE_DIR is None:
build_env['CXXFLAGS'] = build_env.get('CXXFLAGS', '') + " -fexceptions" build_env['CXXFLAGS'] = build_env.get('CXXFLAGS', '') + " -fexceptions"
build_env['LDFLAGS'] = build_env.get('LDFLAGS', '') + " -fexceptions" build_env['LDFLAGS'] = build_env.get('LDFLAGS', '') + " -fexceptions"
IS_SINGLE_THREADED = True IS_SINGLE_THREADED = True
ENABLE_LTO = False
# build with pthread doesn't work. The WASM bindings are also single threaded. # build with pthread doesn't work. The WASM bindings are also single threaded.
else: else:
@ -122,6 +124,7 @@ def _z3_version():
def _configure_z3(): def _configure_z3():
global IS_SINGLE_THREADED global IS_SINGLE_THREADED
global ENABLE_LTO
# bail out early if we don't need to do this - it forces a rebuild every time otherwise # bail out early if we don't need to do this - it forces a rebuild every time otherwise
if os.path.exists(BUILD_DIR): if os.path.exists(BUILD_DIR):
return return
@ -136,7 +139,7 @@ def _configure_z3():
'CMAKE_BUILD_TYPE' : 'Release', 'CMAKE_BUILD_TYPE' : 'Release',
'Z3_BUILD_EXECUTABLE' : True, 'Z3_BUILD_EXECUTABLE' : True,
'Z3_BUILD_LIBZ3_SHARED' : True, 'Z3_BUILD_LIBZ3_SHARED' : True,
'Z3_LINK_TIME_OPTIMIZATION' : True, 'Z3_LINK_TIME_OPTIMIZATION' : ENABLELTO,
'WARNINGS_AS_ERRORS' : 'SERIOUS_ONLY', 'WARNINGS_AS_ERRORS' : 'SERIOUS_ONLY',
# Disable Unwanted Options # Disable Unwanted Options
'Z3_USE_LIB_GMP' : False, # Is default false in python build 'Z3_USE_LIB_GMP' : False, # Is default false in python build