3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 09:34:08 +00:00

auto gen dotnet support

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-26 16:31:58 -07:00
parent 3e89fc092e
commit 25e2353c27
2 changed files with 28 additions and 3 deletions

View file

@ -1,5 +1,5 @@
CXX=cl
CXXFLAGS=/c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D Z3DEBUG /D _CONSOLE /D _TRACE /D _WINDOWS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /openmp /Gd /analyze-
CXXFLAGS=/c /Zi /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D Z3DEBUG /D _CONSOLE /D _TRACE /D _WINDOWS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /openmp /Gd /analyze-
CXX_OUT_FLAG=/Fo
OBJ_EXT=.obj
LIB_EXT=.lib

View file

@ -160,6 +160,9 @@ def is_verbose():
def get_cpp_files(path):
return filter(lambda f: f.endswith('.cpp'), os.listdir(path))
def get_cs_files(path):
return filter(lambda f: f.endswith('.cs'), os.listdir(path))
def find_all_deps(name, deps):
new_deps = []
for dep in deps:
@ -418,8 +421,30 @@ class DotNetDLLComponent(Component):
def mk_makefile(self, out):
if IS_WINDOW:
# TODO
out.write('%s: \n\n' % self.name)
cs_fp_files = []
cs_files = []
for cs_file in get_cs_files(self.src_dir):
cs_fp_files.append('%s/%s' % (self.to_src_dir, cs_file))
cs_files.append(cs_file)
if self.assembly_info_dir != '.':
for cs_file in get_cs_files('%s/%s' % (self.src_dir, self.assembly_info_dir)):
cs_fp_files.append('%s/%s/%s' % (self.to_src_dir, self.assembly_info_dir, cs_file))
cs_files.append('%s\%s' % (self.assembly_info_dir, cs_file))
dllfile = '%s.dll' % self.dll_name
out.write('%s:' % dllfile)
for cs_file in cs_fp_files:
out.write(' ')
out.write(cs_file)
out.write('\n')
out.write(' cd %s && csc /noconfig /unsafe+ /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:mscorlib.dll /reference:System.Core.dll /reference:System.dll /reference:System.Numerics.dll /debug+ /debug:full /filealign:512 /optimize- /out:%s.dll /target:library' % (self.to_src_dir, self.dll_name))
for cs_file in cs_files:
out.write(' ')
out.write(cs_file)
out.write('\n')
# HACK
win_to_src_dir = self.to_src_dir.replace('/', '\\')
out.write(' move %s\%s\n' % (win_to_src_dir, dllfile))
out.write('%s: %s\n\n' % (self.name, dllfile))
return
def main_component(self):