mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 09:34:08 +00:00
Added support for windows DLLs
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
25f8086302
commit
d7930da9a8
|
@ -12,4 +12,9 @@ LINK_FLAGS=/nologo /MDd
|
|||
LINK_EXTRA_FLAGS=/link /DEBUG /MACHINE:X86 /SUBSYSTEM:CONSOLE /INCREMENTAL:NO /STACK:"8388608" /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT
|
||||
LINK_OUT_FLAG=/Fe
|
||||
|
||||
SO_EXT=.dll
|
||||
SLINK=cl
|
||||
SLINK_FLAGS=/nologo /LDd
|
||||
SLINK_EXTRA_FLAGS=/link /DEBUG /MACHINE:X86 /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /STACK:"8388608" /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE:NO
|
||||
SLINK_OUT_FLAG=/Fe
|
||||
|
||||
|
|
|
@ -12,4 +12,9 @@ LINK_FLAGS=/nologo /MD
|
|||
LINK_EXTRA_FLAGS=/link /MACHINE:X86 /SUBSYSTEM:CONSOLE /INCREMENTAL:NO /STACK:"8388608" /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT
|
||||
LINK_OUT_FLAG=/Fe
|
||||
|
||||
SO_EXT=.dll
|
||||
SLINK=cl
|
||||
SLINK_FLAGS=/nologo /LD
|
||||
SLINK_EXTRA_FLAGS=/link /MACHINE:X86 /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /STACK:"8388608" /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE:NO
|
||||
SLINK_OUT_FLAG=/Fe
|
||||
|
||||
|
|
|
@ -62,6 +62,6 @@ add_lib('portfolio', ['smtlogic_tactics', 'ufbv_tactic', 'fpa', 'aig', 'muz_qe',
|
|||
add_lib('api', ['portfolio', 'user_plugin'])
|
||||
add_exe('shell', ['api', 'sat', 'extra_cmds'], exe_name='z3')
|
||||
add_exe('test', ['api', 'fuzzing'], exe_name='test-z3')
|
||||
add_dll('api_dll', ['api', 'sat', 'extra_cmds'], 'api/dll', dll_name='libz3')
|
||||
add_dll('api_dll', ['api', 'sat', 'extra_cmds'], 'api/dll', dll_name='z3')
|
||||
|
||||
mk_makefile()
|
||||
|
|
|
@ -312,8 +312,10 @@ class DLLComponent(Component):
|
|||
global _Name2Component
|
||||
Component.mk_makefile(self, out)
|
||||
# generate rule for (SO_EXT)
|
||||
|
||||
dllfile = '%s$(SO_EXT)' % self.dll_name
|
||||
if IS_WINDOW:
|
||||
dllfile = '%s$(SO_EXT)' % self.dll_name
|
||||
else:
|
||||
dllfile = '%libs$(SO_EXT)' % self.dll_name
|
||||
out.write('%s:' % dllfile)
|
||||
deps = sort_components(self.deps)
|
||||
objs = []
|
||||
|
@ -334,7 +336,10 @@ class DLLComponent(Component):
|
|||
for dep in deps:
|
||||
c_dep = _Name2Component[dep]
|
||||
out.write(' %s/%s$(LIB_EXT)' % (c_dep.build_dir, c_dep.name))
|
||||
out.write(' $(SLINK_EXTRA_FLAGS)\n')
|
||||
out.write(' $(SLINK_EXTRA_FLAGS)')
|
||||
if IS_WINDOW:
|
||||
out.write(' /DEF:%s/%s.def' % (self.to_src_dir, self.name))
|
||||
out.write('\n')
|
||||
out.write('%s: %s\n\n' % (self.name, dllfile))
|
||||
|
||||
# All DLLs are included in the all: rule
|
||||
|
@ -405,6 +410,9 @@ def mk_makefile():
|
|||
print " compilation mode: Debug"
|
||||
else:
|
||||
print " compilation mode: Release"
|
||||
print "Type 'cd %s; make' to build Z3" % BUILD_DIR
|
||||
if IS_WINDOW:
|
||||
print "Type 'cd %s && nmake to build Z3" % BUILD_DIR
|
||||
else:
|
||||
print "Type 'cd %s; make' to build Z3" % BUILD_DIR
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from z3consts import *
|
|||
|
||||
def _find_lib():
|
||||
_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
libs = ['z3.dll', 'libz3.so', 'libz3.dylib']
|
||||
libs = ['z3.dll', 'libz3.so', 'libz3.dylib', 'libz3.dll']
|
||||
if sys.maxsize > 2**32:
|
||||
locs = [_dir, '%s%s..%sx64%sexternal' % (_dir, os.sep, os.sep, os.sep), '%s%s..%sbin%sexternal' % (_dir, os.sep, os.sep, os.sep)]
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue