3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00

FINISH IT

This commit is contained in:
Andrew Dutcher 2016-08-27 19:36:53 -05:00
parent 0bbd172af3
commit 704105306c
5 changed files with 116 additions and 38 deletions

View file

@ -2748,6 +2748,7 @@ def cp_z3py_to_build():
if compileall.compile_dir(Z3PY_SRC_DIR, force=1) != 1:
raise MKException("failed to compile Z3Py sources")
# Copy sources to build
shutil.rmtree(z3py_dest, ignore_errors=True)
shutil.copytree(z3py_src, z3py_dest)
if is_verbose():
print("Copied python bindings")

View file

@ -1600,6 +1600,7 @@ def write_core_py_preamble(core_py):
core_py.write('# Automatically generated file\n')
core_py.write('import sys, os\n')
core_py.write('import ctypes\n')
core_py.write('import pkg_resources\n')
core_py.write('from .z3types import *\n')
core_py.write('from .z3consts import *\n')
core_py.write(
@ -1608,15 +1609,15 @@ _lib = None
def lib():
global _lib
if _lib == None:
_dir = os.path.dirname(os.path.abspath(__file__))
_dir = pkg_resources.resource_filename('z3', 'lib')
for ext in ['dll', 'so', 'dylib']:
try:
init('libz3.%s' % ext)
init(os.path.join(_dir, 'libz3.%s' % ext))
break
except:
pass
try:
init(os.path.join(_dir, 'libz3.%s' % ext))
init('libz3.%s' % ext)
break
except:
pass