Skip to content

Commit

Permalink
update mk-win-dist-cmake
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Feb 3, 2024
1 parent 736d634 commit 14fb235
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions scripts/mk_win_dist_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def getenv(name, default):
DOTNET_CORE_ENABLED = True
DOTNET_KEY_FILE = None
JAVA_ENABLED = True
JULIA_ENABLED = False
ZIP_BUILD_OUTPUTS = False
GIT_HASH = False
PYTHON_ENABLED = True
Expand Down Expand Up @@ -81,17 +80,13 @@ def get_bin_dist_path(arch):
def get_dist_path(arch):
return os.path.join(DIST_DIR, arch)


def set_build_dir(path):
global BUILD_DIR, BUILD_X86_DIR, BUILD_X64_DIR, BUILD_ARM64_DIR, ARCHITECTURES
BUILD_DIR = os.path.expanduser(os.path.normpath(path))
BUILD_X86_DIR = os.path.join(path, 'x86')
BUILD_X64_DIR = os.path.join(path, 'x64')
BUILD_ARM64_DIR = os.path.join(path, 'arm64') # Set ARM64 build directory
ARCHITECTURES = {'x64': BUILD_X64_DIR, 'x86':BUILD_X86_DIR, 'arm64':BUILD_ARM64_DIR}
mk_dir(BUILD_X86_DIR)
mk_dir(BUILD_X64_DIR)
mk_dir(BUILD_ARM64_DIR)

def display_help():
print("mk_win_dist.py: Z3 Windows distribution generator\n")
Expand All @@ -108,7 +103,6 @@ def display_help():
print(" --dotnet-key=<file> strongname sign the .NET assembly with the private key in <file>.")
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(" --julia build Julia bindings.")
print(" --zip package build outputs in zip file.")
print(" --githash include git hash in the Zip file.")
print(" --x86-only x86 dist only.")
Expand All @@ -118,7 +112,7 @@ def display_help():

# Parse configuration option for mk_make script
def parse_options():
global FORCE_MK, JAVA_ENABLED, JULIA_ENABLED, ZIP_BUILD_OUTPUTS, GIT_HASH, DOTNET_CORE_ENABLED, DOTNET_KEY_FILE, ASSEMBLY_VERSION, PYTHON_ENABLED, X86ONLY, X64ONLY, ARM64ONLY
global FORCE_MK, JAVA_ENABLED, ZIP_BUILD_OUTPUTS, GIT_HASH, DOTNET_CORE_ENABLED, DOTNET_KEY_FILE, ASSEMBLY_VERSION, PYTHON_ENABLED, X86ONLY, X64ONLY, ARM64ONLY
path = BUILD_DIR
options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:hsf', ['build=',
'help',
Expand All @@ -131,7 +125,6 @@ def parse_options():
'zip',
'githash',
'nopython',
'julia',
'x86-only',
'x64-only',
'arm64-only'
Expand All @@ -157,8 +150,6 @@ def parse_options():
DOTNET_KEY_FILE = arg
elif opt == '--nojava':
JAVA_ENABLED = False
elif opt == '--julia':
JULIA_ENABLED = True
elif opt == '--zip':
ZIP_BUILD_OUTPUTS = True
elif opt == '--githash':
Expand Down Expand Up @@ -208,10 +199,6 @@ def mk_build_dir(arch):
arch = "amd64_arm64"

cmds = []
if JULIA_ENABLED:
cmds.append('julia -e "using Pkg; Pkg.add(PackageSpec(name=\"libcxxwrap_julia_jll\"))"')
cmds.append('julia -e "using libcxxwrap_julia_jll; print(dirname(libcxxwrap_julia_jll.libcxxwrap_julia_path))" > tmp.env')
cmds.append('set /P JlCxxDir=<tmp.env')
cmds.append(f"cd {build_path}")
cmds.append('call "%VCINSTALLDIR%Auxiliary\\build\\vcvarsall.bat" ' + arch)
cmd = []
Expand All @@ -228,9 +215,6 @@ def mk_build_dir(arch):
cmd.append(' -DZ3_BUILD_PYTHON_BINDINGS=ON')
cmd.append(' -DZ3_INSTALL_PYTHON_BINDINGS=ON')
cmd.append(' -DCMAKE_INSTALL_PYTHON_PKG_DIR=bin/python')
if JULIA_ENABLED:
cmd.append(' -DJlCxx_DIR=%JlCxxDir%\\..\\lib\\cmake\\JlCxx')
cmd.append(' -DZ3_BUILD_JULIA_BINDINGS=True')

if GIT_HASH:
git_hash = get_git_hash()
Expand Down

0 comments on commit 14fb235

Please sign in to comment.