mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 02:45:51 +00:00
When using Mono support for installing/uninstalling the bindings is also implemented. For Windows install/uninstall is not implemented because the python build system does not implement it and Microsoft's documentation (https://msdn.microsoft.com/en-us/library/dkkx7f79.aspx) says that the gacutil should only be used for development and not for production. For now a warning is just emitted if ``INSTALL_DOTNET_BINDINGS`` is enabled and the .NET toolchain is native Windows. Someone with better knowledge of how to correctly install assemblies under Windows should implement this or remove this message. A notable difference from the Python build system is the ``/linkresource:`` flag is not passed to the C# compiler. This means a user of the .NET bindings will have to copy the Z3 library (i.e. ``libz3.dll``) to their application directory manually. The reason for this difference is that using this flag requires the working directory to be the directory containing the Z3 library (i.e. ``libz3.dll``) but setting this up with multi-configuration generators doesn't currently seem possible.
18 lines
532 B
CMake
18 lines
532 B
CMake
# Install assembly to the GAC
|
|
set(GAC_ROOT "$ENV{DESTDIR}@CMAKE_INSTALL_FULL_LIBDIR@")
|
|
execute_process(COMMAND
|
|
"@DOTNET_GACUTIL_EXECUTABLE@"
|
|
"-i"
|
|
"@Z3_DOTNET_ASSEMBLY_DLL@"
|
|
"-f"
|
|
"-package" "@GAC_PKG_NAME@"
|
|
"-root" "${GAC_ROOT}"
|
|
WORKING_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@"
|
|
RESULT_VARIABLE gacutil_exit_code
|
|
)
|
|
|
|
if ("${gacutil_exit_code}" EQUAL 0)
|
|
message(STATUS "Installed \"@Z3_DOTNET_ASSEMBLY_DLL@\" to the GAC")
|
|
else()
|
|
message(FATAL_ERROR "Failed to install \"@Z3_DOTNET_ASSEMBLY_DLL@\" to the GAC")
|
|
endif()
|