3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-09 15:43:25 +00:00

added --nodotnet option to mk_make.py

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-30 17:47:37 -07:00
parent b1ce9f796c
commit 5a33882746

View file

@ -39,6 +39,7 @@ ONLY_MAKEFILES = False
Z3PY_SRC_DIR=None Z3PY_SRC_DIR=None
VS_PROJ = False VS_PROJ = False
TRACE = False TRACE = False
DOTNET_ENABLED=False
VER_MAJOR=None VER_MAJOR=None
VER_MINOR=None VER_MINOR=None
@ -101,6 +102,8 @@ if os.name == 'nt':
IS_WINDOW=True IS_WINDOW=True
# Visual Studio already displays the files being compiled # Visual Studio already displays the files being compiled
SHOW_CPPS=False SHOW_CPPS=False
# Enable .Net bindings by default on windows
DOTNET_ENABLED=True
def display_help(): def display_help():
print "mk_make.py: Z3 Makefile generator\n" print "mk_make.py: Z3 Makefile generator\n"
@ -116,12 +119,13 @@ def display_help():
print " -c, --showcpp display file .cpp file names before invoking compiler." print " -c, --showcpp display file .cpp file names before invoking compiler."
print " -v, --vsproj generate Visual Studio Project Files." print " -v, --vsproj generate Visual Studio Project Files."
print " -t, --trace enable tracing in release mode." print " -t, --trace enable tracing in release mode."
print " -n, --nodotnet do not generate Microsoft.Z3.dll make rules."
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 VERBOSE, DEBUG_MODE, IS_WINDOW, VS_X64, ONLY_MAKEFILES, SHOW_CPPS, VS_PROJ, TRACE global VERBOSE, DEBUG_MODE, IS_WINDOW, VS_X64, ONLY_MAKEFILES, SHOW_CPPS, VS_PROJ, TRACE, DOTNET_ENABLED
options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:dsxhmcvt', ['build=', options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:dsxhmcvtn', ['build=',
'debug', 'debug',
'silent', 'silent',
'x64', 'x64',
@ -129,7 +133,8 @@ def parse_options():
'makefiles', 'makefiles',
'showcpp', 'showcpp',
'vsproj', 'vsproj',
'trace' 'trace',
'nodotnet'
]) ])
for opt, arg in options: for opt, arg in options:
if opt in ('-b', '--build'): if opt in ('-b', '--build'):
@ -154,6 +159,8 @@ def parse_options():
VS_PROJ = True VS_PROJ = True
elif opt in ('-t', '--trace'): elif opt in ('-t', '--trace'):
TRACE = True TRACE = True
elif opt in ('-n', '--nodotnet'):
DOTNET_ENABLED = False
else: else:
raise MKException("Invalid command line option '%s'" % opt) raise MKException("Invalid command line option '%s'" % opt)
@ -583,7 +590,7 @@ class DotNetDLLComponent(Component):
self.assembly_info_dir = assembly_info_dir self.assembly_info_dir = assembly_info_dir
def mk_makefile(self, out): def mk_makefile(self, out):
if IS_WINDOW: if DOTNET_ENABLED:
cs_fp_files = [] cs_fp_files = []
cs_files = [] cs_files = []
for cs_file in get_cs_files(self.src_dir): for cs_file in get_cs_files(self.src_dir):
@ -612,12 +619,13 @@ class DotNetDLLComponent(Component):
return return
def main_component(self): def main_component(self):
return IS_WINDOW return DOTNET_ENABLED
def has_assembly_info(self): def has_assembly_info(self):
return True return True
def mk_win_dist(self, build_path, dist_path): def mk_win_dist(self, build_path, dist_path):
if DOTNET_ENABLED:
# Assuming all DotNET dll should be in the distribution # Assuming all DotNET dll should be in the distribution
mk_dir('%s/bin' % dist_path) mk_dir('%s/bin' % dist_path)
shutil.copy('%s/%s.dll' % (build_path, self.dll_name), shutil.copy('%s/%s.dll' % (build_path, self.dll_name),
@ -685,7 +693,7 @@ class DotNetExampleComponent(ExampleComponent):
return IS_WINDOW return IS_WINDOW
def mk_makefile(self, out): def mk_makefile(self, out):
if IS_WINDOW: if DOTNET_ENABLED:
dll_name = get_component(DOTNET_COMPONENT).dll_name dll_name = get_component(DOTNET_COMPONENT).dll_name
dll = '%s.dll' % dll_name dll = '%s.dll' % dll_name
exefile = '%s.exe' % self.name exefile = '%s.exe' % self.name