mirror of
https://github.com/Z3Prover/z3
synced 2025-06-07 06:33:23 +00:00
more dotnet core prepration
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
540922766d
commit
52801db3fd
2 changed files with 14 additions and 68 deletions
|
@ -892,7 +892,6 @@ def is_dotnet_enabled():
|
||||||
return DOTNET_ENABLED
|
return DOTNET_ENABLED
|
||||||
|
|
||||||
def is_dotnet_core_enabled():
|
def is_dotnet_core_enabled():
|
||||||
print("core %s" % DOTNET_CORE_ENABLED)
|
|
||||||
return DOTNET_CORE_ENABLED
|
return DOTNET_CORE_ENABLED
|
||||||
|
|
||||||
def is_python_enabled():
|
def is_python_enabled():
|
||||||
|
@ -1875,75 +1874,22 @@ class DotNetCoreDLLComponent(Component):
|
||||||
out.write(cs_file)
|
out.write(cs_file)
|
||||||
out.write('\n')
|
out.write('\n')
|
||||||
|
|
||||||
dotnetCmdLine = [DOTNET]
|
# TBD: can this be replaced by running "dotnet new classlib"?
|
||||||
if IS_WINDOWS:
|
csproj = os.path.join(self.to_src_dir, "core", "core.csproj")
|
||||||
# Using these flags under the mono compiler results in build errors.
|
dotnetCmdLine = [DOTNET, "build", csproj]
|
||||||
dotnetCmdLine.extend( [# What is the motivation for this?
|
|
||||||
'/noconfig',
|
# TBD: select build configurations also based on architecture
|
||||||
'/nostdlib+',
|
# Debug|x86, Debug|x64, Debug|arm
|
||||||
'/reference:mscorlib.dll',
|
# Release|x86, Release|x64, Release|arm
|
||||||
]
|
dotnetCmdLine.extend(['-c'])
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
if not self.key_file is None:
|
|
||||||
print("%s.dll will be signed using key '%s'." % (self.dll_name, self.key_file))
|
|
||||||
if (self.key_file.find(' ') != -1):
|
|
||||||
self.key_file = '"' + self.key_file + '"'
|
|
||||||
dotnetCmdLine.append('/keyfile:{}'.format(self.key_file))
|
|
||||||
|
|
||||||
dotnetCmdLine.extend( ['/unsafe+',
|
|
||||||
'/nowarn:1701,1702',
|
|
||||||
'/errorreport:prompt',
|
|
||||||
'/warn:4',
|
|
||||||
'/reference:System.Core.dll',
|
|
||||||
'/reference:System.dll',
|
|
||||||
'/reference:System.Numerics.dll',
|
|
||||||
'/filealign:512', # Why!?
|
|
||||||
'/out:{}.dll'.format(self.dll_name),
|
|
||||||
'/target:library',
|
|
||||||
'/doc:{}.xml'.format(self.dll_name),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
if DEBUG_MODE:
|
if DEBUG_MODE:
|
||||||
dotnetCmdLine.extend( ['"/define:DEBUG;TRACE"', # Needs to be quoted due to ``;`` being a shell command separator
|
dotnetCmdLine.extend(['Debug'])
|
||||||
'/debug+',
|
|
||||||
'/debug:full',
|
|
||||||
'/optimize-'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
dotnetCmdLine.extend(['/optimize+'])
|
dotnetCmdLine.extend(['Release'])
|
||||||
|
|
||||||
if IS_WINDOWS:
|
|
||||||
if VS_X64:
|
|
||||||
dotnetCmdLine.extend(['/platform:x64'])
|
|
||||||
elif VS_ARM:
|
|
||||||
dotnetCmdLine.extend(['/platform:arm'])
|
|
||||||
else:
|
|
||||||
dotnetCmdLine.extend(['/platform:x86'])
|
|
||||||
else:
|
|
||||||
# Just use default platform for now.
|
|
||||||
# If the dlls are run using mono then it
|
|
||||||
# ignores what the platform is set to anyway.
|
|
||||||
pass
|
|
||||||
|
|
||||||
for cs_file in cs_files:
|
|
||||||
dotnetCmdLine.append('{}'.format(os.path.join(self.to_src_dir, cs_file)))
|
|
||||||
|
|
||||||
|
path = os.path.abspath(BUILD_DIR)
|
||||||
|
dotnetCmdLine.extend(['-o', path])
|
||||||
|
|
||||||
# Now emit the command line
|
# Now emit the command line
|
||||||
MakeRuleCmd.write_cmd(out, ' '.join(dotnetCmdLine))
|
MakeRuleCmd.write_cmd(out, ' '.join(dotnetCmdLine))
|
||||||
|
|
||||||
|
|
|
@ -1868,7 +1868,7 @@ def generate_files(api_files,
|
||||||
mk_dotnet_wrappers(dotnet_file)
|
mk_dotnet_wrappers(dotnet_file)
|
||||||
if mk_util.is_verbose():
|
if mk_util.is_verbose():
|
||||||
print("Generated '{}'".format(dotnet_file.name))
|
print("Generated '{}'".format(dotnet_file.name))
|
||||||
|
|
||||||
if java_output_dir:
|
if java_output_dir:
|
||||||
mk_java(java_output_dir, java_package_name)
|
mk_java(java_output_dir, java_package_name)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue