diff --git a/scripts/mk_unix_dist.py b/scripts/mk_unix_dist.py index 00cf3c706..06d87cd63 100644 --- a/scripts/mk_unix_dist.py +++ b/scripts/mk_unix_dist.py @@ -186,7 +186,11 @@ def mk_dist_dir(): build_path = BUILD_DIR dist_path = os.path.join(DIST_DIR, get_z3_name()) mk_dir(dist_path) - mk_util.DOTNET_ENABLED = DOTNET_ENABLED + name = get_z3_name() + if "x64" in name or "mac" in name: + mk_util.DOTNET_CORE_ENABLED = DOTNET_ENABLED + else: + mk_util.DOTNET_ENABLED = DOTNET_ENABLED mk_util.DOTNET_KEY_FILE = DOTNET_KEY_FILE mk_util.JAVA_ENABLED = JAVA_ENABLED mk_util.PYTHON_ENABLED = PYTHON_ENABLED diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 790de530d..bb91df59b 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -668,6 +668,7 @@ def display_help(exit_code): if IS_WINDOWS: print(" -v, --vsproj generate Visual Studio Project Files.") print(" --optimize generate optimized code during linking.") + print(" --dotnetcore generate .NET platform bindings.") print(" --dotnet generate .NET bindings.") print(" --dotnet-key= sign the .NET assembly using the private key in .") print(" --java generate Java bindings.") @@ -1627,6 +1628,23 @@ class PythonInstallComponent(Component): def mk_makefile(self, out): return +def set_key_file(self): + global DOTNET_KEY_FILE + # We need to give the assembly a strong name so that it + # can be installed into the GAC with ``make install`` + if not DOTNET_KEY_FILE is None: + self.key_file = DOTNET_KEY_FILE + + if not self.key_file is None: + if os.path.isfile(self.key_file): + self.key_file = os.path.abspath(self.key_file) + elif os.path.isfile(os.path.join(self.src_dir, self.key_file)): + self.key_file = os.path.abspath(os.path.join(self.src_dir, self.key_file)) + else: + print("Keyfile '%s' could not be found; %s.dll will be unsigned." % (self.key_file, self.dll_name)) + self.key_file = None + + class DotNetDLLComponent(Component): def __init__(self, name, dll_name, path, deps, assembly_info_dir, default_key_file): Component.__init__(self, name, path, deps) @@ -1688,19 +1706,7 @@ class DotNetDLLComponent(Component): ] ) - # We need to give the assembly a strong name so that it - # can be installed into the GAC with ``make install`` - if not DOTNET_KEY_FILE is None: - self.key_file = DOTNET_KEY_FILE - - if not self.key_file is None: - if os.path.isfile(self.key_file): - self.key_file = os.path.abspath(self.key_file) - elif os.path.isfile(os.path.join(self.src_dir, self.key_file)): - self.key_file = os.path.abspath(os.path.join(self.src_dir, self.key_file)) - else: - print("Keyfile '%s' could not be found; %s.dll will be unsigned." % (self.key_file, self.dll_name)) - self.key_file = None + set_key_file(self) if not self.key_file is None: print("%s.dll will be signed using key '%s'." % (self.dll_name, self.key_file)) @@ -1843,8 +1849,6 @@ class DotNetCoreDLLComponent(Component): def mk_makefile(self, out): - # TBD: handle keyfile - global DOTNET_KEY_FILE if not is_dotnet_core_enabled(): return cs_fp_files = [] @@ -1859,6 +1863,11 @@ class DotNetCoreDLLComponent(Component): out.write(' ') out.write(cs_file) out.write('\n') + + set_key_file(self) + key = "" + if not self.key_file is None: + key = "%s" % self.key_file if VS_X64: platform = 'x64' @@ -1887,13 +1896,14 @@ class DotNetCoreDLLComponent(Component): Z3 is a satisfiability modulo theories solver from Microsoft Research. Copyright Microsoft Corporation. All rights reserved. smt constraint solver theorem prover + %s -""" % (platform, version, self.to_src_dir) +""" % (platform, version, key, self.to_src_dir) mk_dir(os.path.join(BUILD_DIR, 'dotnet')) csproj = os.path.join('dotnet', 'z3.csproj') diff --git a/scripts/mk_win_dist.py b/scripts/mk_win_dist.py index 9e0374192..10865676d 100644 --- a/scripts/mk_win_dist.py +++ b/scripts/mk_win_dist.py @@ -208,7 +208,7 @@ def mk_dist_dir(x64): build_path = BUILD_X86_DIR dist_path = os.path.join(DIST_DIR, get_z3_name(x64)) mk_dir(dist_path) - mk_util.DOTNET_ENABLED = DOTNET_ENABLED + mk_util.DOTNET_CORE_ENABLED = DOTNET_ENABLED mk_util.DOTNET_KEY_FILE = DOTNET_KEY_FILE mk_util.JAVA_ENABLED = JAVA_ENABLED mk_util.PYTHON_ENABLED = PYTHON_ENABLED