mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
Separated win32/64 builds
This commit is contained in:
parent
d8e4966a11
commit
b30f3a6dbd
|
@ -29,6 +29,9 @@ DOTNET_KEY_FILE=None
|
||||||
JAVA_ENABLED=True
|
JAVA_ENABLED=True
|
||||||
GIT_HASH=False
|
GIT_HASH=False
|
||||||
PYTHON_ENABLED=True
|
PYTHON_ENABLED=True
|
||||||
|
X86ONLY=False
|
||||||
|
X64ONLY=False
|
||||||
|
MAKEJOBS=getenv("MAKEJOBS", 24)
|
||||||
|
|
||||||
def set_verbose(flag):
|
def set_verbose(flag):
|
||||||
global VERBOSE
|
global VERBOSE
|
||||||
|
@ -63,11 +66,13 @@ def display_help():
|
||||||
print(" --nojava do not include Java bindings in the binary distribution files.")
|
print(" --nojava do not include Java bindings in the binary distribution files.")
|
||||||
print(" --nopython do not include Python bindings in the binary distribution files.")
|
print(" --nopython do not include Python bindings in the binary distribution files.")
|
||||||
print(" --githash include git hash in the Zip file.")
|
print(" --githash include git hash in the Zip file.")
|
||||||
|
print(" --x86-only x86 dist only.")
|
||||||
|
print(" --x64-only x64 dist only.")
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
# Parse configuration option for mk_make script
|
# Parse configuration option for mk_make script
|
||||||
def parse_options():
|
def parse_options():
|
||||||
global FORCE_MK, JAVA_ENABLED, GIT_HASH, DOTNET_ENABLED, DOTNET_KEY_FILE, PYTHON_ENABLED
|
global FORCE_MK, JAVA_ENABLED, GIT_HASH, DOTNET_ENABLED, DOTNET_KEY_FILE, PYTHON_ENABLED, X86ONLY, X64ONLY
|
||||||
path = BUILD_DIR
|
path = BUILD_DIR
|
||||||
options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:hsf', ['build=',
|
options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:hsf', ['build=',
|
||||||
'help',
|
'help',
|
||||||
|
@ -77,7 +82,9 @@ def parse_options():
|
||||||
'nodotnet',
|
'nodotnet',
|
||||||
'dotnet-key=',
|
'dotnet-key=',
|
||||||
'githash',
|
'githash',
|
||||||
'nopython'
|
'nopython',
|
||||||
|
'x86-only',
|
||||||
|
'x64-only'
|
||||||
])
|
])
|
||||||
for opt, arg in options:
|
for opt, arg in options:
|
||||||
if opt in ('-b', '--build'):
|
if opt in ('-b', '--build'):
|
||||||
|
@ -100,6 +107,10 @@ def parse_options():
|
||||||
JAVA_ENABLED = False
|
JAVA_ENABLED = False
|
||||||
elif opt == '--githash':
|
elif opt == '--githash':
|
||||||
GIT_HASH = True
|
GIT_HASH = True
|
||||||
|
elif opt == '--x86-only' and not X64ONLY:
|
||||||
|
X86ONLY = True
|
||||||
|
elif opt == '--x64-only' and not X86ONLY:
|
||||||
|
X64ONLY = True
|
||||||
else:
|
else:
|
||||||
raise MKException("Invalid command line option '%s'" % opt)
|
raise MKException("Invalid command line option '%s'" % opt)
|
||||||
set_build_dir(path)
|
set_build_dir(path)
|
||||||
|
@ -111,7 +122,8 @@ def check_build_dir(path):
|
||||||
# Create a build directory using mk_make.py
|
# Create a build directory using mk_make.py
|
||||||
def mk_build_dir(path, x64):
|
def mk_build_dir(path, x64):
|
||||||
if not check_build_dir(path) or FORCE_MK:
|
if not check_build_dir(path) or FORCE_MK:
|
||||||
opts = ["python", os.path.join('scripts', 'mk_make.py'), "--parallel=24", "-b", path]
|
parallel = '--parallel=' + MAKEJOBS
|
||||||
|
opts = ["python", os.path.join('scripts', 'mk_make.py'), parallel, "-b", path]
|
||||||
if DOTNET_ENABLED:
|
if DOTNET_ENABLED:
|
||||||
opts.append('--dotnet')
|
opts.append('--dotnet')
|
||||||
if not DOTNET_KEY_FILE is None:
|
if not DOTNET_KEY_FILE is None:
|
||||||
|
@ -160,7 +172,7 @@ def exec_cmds(cmds):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
# Compile Z3 (if x64 == True, then it builds it in x64 mode).
|
# Compile Z3 (if x64 == True, then it builds it in x64 mode).
|
||||||
def mk_z3_core(x64):
|
def mk_z3(x64):
|
||||||
cmds = []
|
cmds = []
|
||||||
if x64:
|
if x64:
|
||||||
cmds.append('call "%VCINSTALLDIR%vcvarsall.bat" amd64')
|
cmds.append('call "%VCINSTALLDIR%vcvarsall.bat" amd64')
|
||||||
|
@ -172,9 +184,9 @@ def mk_z3_core(x64):
|
||||||
if exec_cmds(cmds) != 0:
|
if exec_cmds(cmds) != 0:
|
||||||
raise MKException("Failed to make z3, x64: %s" % x64)
|
raise MKException("Failed to make z3, x64: %s" % x64)
|
||||||
|
|
||||||
def mk_z3():
|
def mk_z3s():
|
||||||
mk_z3_core(False)
|
mk_z3(False)
|
||||||
mk_z3_core(True)
|
mk_z3(True)
|
||||||
|
|
||||||
def get_z3_name(x64):
|
def get_z3_name(x64):
|
||||||
major, minor, build, revision = get_version()
|
major, minor, build, revision = get_version()
|
||||||
|
@ -187,7 +199,7 @@ def get_z3_name(x64):
|
||||||
else:
|
else:
|
||||||
return 'z3-%s.%s.%s-%s-win' % (major, minor, build, platform)
|
return 'z3-%s.%s.%s-%s-win' % (major, minor, build, platform)
|
||||||
|
|
||||||
def mk_dist_dir_core(x64):
|
def mk_dist_dir(x64):
|
||||||
if x64:
|
if x64:
|
||||||
platform = "x64"
|
platform = "x64"
|
||||||
build_path = BUILD_X64_DIR
|
build_path = BUILD_X64_DIR
|
||||||
|
@ -204,14 +216,14 @@ def mk_dist_dir_core(x64):
|
||||||
if is_verbose():
|
if is_verbose():
|
||||||
print("Generated %s distribution folder at '%s'" % (platform, dist_path))
|
print("Generated %s distribution folder at '%s'" % (platform, dist_path))
|
||||||
|
|
||||||
def mk_dist_dir():
|
def mk_dist_dirs():
|
||||||
mk_dist_dir_core(False)
|
mk_dist_dir(False)
|
||||||
mk_dist_dir_core(True)
|
mk_dist_dir(True)
|
||||||
|
|
||||||
def get_dist_path(x64):
|
def get_dist_path(x64):
|
||||||
return get_z3_name(x64)
|
return get_z3_name(x64)
|
||||||
|
|
||||||
def mk_zip_core(x64):
|
def mk_zip(x64):
|
||||||
dist_path = get_dist_path(x64)
|
dist_path = get_dist_path(x64)
|
||||||
old = os.getcwd()
|
old = os.getcwd()
|
||||||
try:
|
try:
|
||||||
|
@ -228,7 +240,7 @@ def mk_zip_core(x64):
|
||||||
os.chdir(old)
|
os.chdir(old)
|
||||||
|
|
||||||
# Create a zip file for each platform
|
# Create a zip file for each platform
|
||||||
def mk_zip():
|
def mk_zips():
|
||||||
mk_zip_core(False)
|
mk_zip_core(False)
|
||||||
mk_zip_core(True)
|
mk_zip_core(True)
|
||||||
|
|
||||||
|
@ -238,7 +250,7 @@ VS_RUNTIME_PATS = [re.compile('vcomp.*\.dll'),
|
||||||
re.compile('msvcr.*\.dll')]
|
re.compile('msvcr.*\.dll')]
|
||||||
|
|
||||||
# Copy Visual Studio Runtime libraries
|
# Copy Visual Studio Runtime libraries
|
||||||
def cp_vs_runtime_core(x64):
|
def cp_vs_runtime(x64):
|
||||||
if x64:
|
if x64:
|
||||||
platform = "x64"
|
platform = "x64"
|
||||||
|
|
||||||
|
@ -262,27 +274,49 @@ def cp_vs_runtime_core(x64):
|
||||||
if is_verbose():
|
if is_verbose():
|
||||||
print("Copied '%s' to '%s'" % (f, bin_dist_path))
|
print("Copied '%s' to '%s'" % (f, bin_dist_path))
|
||||||
|
|
||||||
def cp_vs_runtime():
|
def cp_vs_runtimes():
|
||||||
cp_vs_runtime_core(True)
|
cp_vs_runtime(True)
|
||||||
cp_vs_runtime_core(False)
|
cp_vs_runtime(False)
|
||||||
|
|
||||||
def cp_license():
|
def cp_license(x64):
|
||||||
shutil.copy("LICENSE.txt", os.path.join(DIST_DIR, get_dist_path(True)))
|
shutil.copy("LICENSE.txt", os.path.join(DIST_DIR, get_dist_path(x64)))
|
||||||
shutil.copy("LICENSE.txt", os.path.join(DIST_DIR, get_dist_path(False)))
|
|
||||||
|
def cp_licenses():
|
||||||
|
cp_license(True)
|
||||||
|
cp_license(False)
|
||||||
|
|
||||||
# Entry point
|
# Entry point
|
||||||
def main():
|
def main():
|
||||||
if os.name != 'nt':
|
if os.name != 'nt':
|
||||||
raise MKException("This script is for Windows only")
|
raise MKException("This script is for Windows only")
|
||||||
|
|
||||||
parse_options()
|
parse_options()
|
||||||
check_vc_cmd_prompt()
|
check_vc_cmd_prompt()
|
||||||
mk_build_dirs()
|
|
||||||
mk_z3()
|
if X86ONLY:
|
||||||
init_project_def()
|
mk_build_dir(BUILD_X86_DIR, False)
|
||||||
mk_dist_dir()
|
mk_z3(False)
|
||||||
cp_license()
|
init_project_def()
|
||||||
cp_vs_runtime()
|
mk_dist_dir(False)
|
||||||
mk_zip()
|
cp_license(False)
|
||||||
|
cp_vs_runtime(False)
|
||||||
|
mk_zip(False)
|
||||||
|
elif X64ONLY:
|
||||||
|
mk_build_dir(BUILD_X64_DIR, True)
|
||||||
|
mk_z3(True)
|
||||||
|
init_project_def()
|
||||||
|
mk_dist_dir(True)
|
||||||
|
cp_license(True)
|
||||||
|
cp_vs_runtime(True)
|
||||||
|
mk_zip(True)
|
||||||
|
else:
|
||||||
|
mk_build_dirs()
|
||||||
|
mk_z3s()
|
||||||
|
init_project_def()
|
||||||
|
mk_dist_dirs()
|
||||||
|
cp_licenses()
|
||||||
|
cp_vs_runtime()
|
||||||
|
mk_zip()
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue