mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 13:29:11 +00:00 
			
		
		
		
	fixed z3py build
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
		
							parent
							
								
									462ea55215
								
							
						
					
					
						commit
						573f3d1725
					
				
					 1 changed files with 14 additions and 11 deletions
				
			
		| 
						 | 
					@ -184,20 +184,10 @@ def set_build_dir(d):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def set_z3py_dir(p):
 | 
					def set_z3py_dir(p):
 | 
				
			||||||
    global SRC_DIR, Z3PY_SRC_DIR
 | 
					    global SRC_DIR, Z3PY_SRC_DIR
 | 
				
			||||||
    mk_dir(BUILD_DIR)
 | 
					 | 
				
			||||||
    full = '%s/%s' % (SRC_DIR, p)
 | 
					    full = '%s/%s' % (SRC_DIR, p)
 | 
				
			||||||
    if not os.path.exists(full):
 | 
					    if not os.path.exists(full):
 | 
				
			||||||
        raise MKException("Python bindings directory '%s' does not exist" % full)
 | 
					        raise MKException("Python bindings directory '%s' does not exist" % full)
 | 
				
			||||||
    Z3PY_SRC_DIR = full
 | 
					    Z3PY_SRC_DIR = full
 | 
				
			||||||
    compileall.compile_dir(Z3PY_SRC_DIR, force=1)
 | 
					 | 
				
			||||||
    for pyc in filter(lambda f: f.endswith('.pyc'), os.listdir(Z3PY_SRC_DIR)):
 | 
					 | 
				
			||||||
        try:
 | 
					 | 
				
			||||||
            os.remove('%s/%s' % (BUILD_DIR, pyc))
 | 
					 | 
				
			||||||
        except:
 | 
					 | 
				
			||||||
            pass
 | 
					 | 
				
			||||||
        os.rename('%s/%s' % (Z3PY_SRC_DIR, pyc), '%s/%s' % (BUILD_DIR, pyc))
 | 
					 | 
				
			||||||
        if is_verbose():
 | 
					 | 
				
			||||||
            print "Generated '%s'" % pyc
 | 
					 | 
				
			||||||
    if VERBOSE:
 | 
					    if VERBOSE:
 | 
				
			||||||
        print "Python bindinds directory was detected."
 | 
					        print "Python bindinds directory was detected."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1008,6 +998,18 @@ def mk_def_files():
 | 
				
			||||||
            if c.require_def_file():
 | 
					            if c.require_def_file():
 | 
				
			||||||
                mk_def_file(c)
 | 
					                mk_def_file(c)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def cp_z3pyc_to_build():
 | 
				
			||||||
 | 
					    mk_dir(BUILD_DIR)
 | 
				
			||||||
 | 
					    compileall.compile_dir(Z3PY_SRC_DIR, force=1)
 | 
				
			||||||
 | 
					    for pyc in filter(lambda f: f.endswith('.pyc'), os.listdir(Z3PY_SRC_DIR)):
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            os.remove('%s/%s' % (BUILD_DIR, pyc))
 | 
				
			||||||
 | 
					        except:
 | 
				
			||||||
 | 
					            pass
 | 
				
			||||||
 | 
					        os.rename('%s/%s' % (Z3PY_SRC_DIR, pyc), '%s/%s' % (BUILD_DIR, pyc))
 | 
				
			||||||
 | 
					        if is_verbose():
 | 
				
			||||||
 | 
					            print "Generated '%s'" % pyc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def mk_bindings(api_files):
 | 
					def mk_bindings(api_files):
 | 
				
			||||||
    if not ONLY_MAKEFILES:
 | 
					    if not ONLY_MAKEFILES:
 | 
				
			||||||
        mk_z3consts_py(api_files)
 | 
					        mk_z3consts_py(api_files)
 | 
				
			||||||
| 
						 | 
					@ -1020,6 +1022,7 @@ def mk_bindings(api_files):
 | 
				
			||||||
        g = {}
 | 
					        g = {}
 | 
				
			||||||
        g["API_FILES"] = new_api_files
 | 
					        g["API_FILES"] = new_api_files
 | 
				
			||||||
        execfile('scripts/update_api.py', g) # HACK
 | 
					        execfile('scripts/update_api.py', g) # HACK
 | 
				
			||||||
 | 
					        cp_z3pyc_to_build()
 | 
				
			||||||
                          
 | 
					                          
 | 
				
			||||||
# Extract enumeration types from API files, and add python definitions.
 | 
					# Extract enumeration types from API files, and add python definitions.
 | 
				
			||||||
def mk_z3consts_py(api_files):
 | 
					def mk_z3consts_py(api_files):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue