mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 21:38:44 +00:00
Merge pull request #575 from delcypher/cmake_minor_dotnet_tweaks
[CMake] Minor ".NET" build tweaks
This commit is contained in:
commit
e31913691f
|
@ -203,12 +203,24 @@ if (DOTNET_TOOLCHAIN_IS_WINDOWS)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# FIXME: The get_property() command only works correctly for single configuration generators
|
# FIXME: Ideally we should emit files into a configuration specific directory
|
||||||
# so we can't use it. We also can't use ``$<TARGET_FILE_DIR:libz3>`` because the ``OUTPUT``
|
# when using multi-configuration generators so that the files generated by each
|
||||||
# argument to ``add_custom_commands()`` won't accept it. For now just output file to the
|
# configuration don't clobber each other. Unfortunately the ``get_property()``
|
||||||
# current binary directory.
|
# command only works correctly for single configuration generators so we can't
|
||||||
# get_property(Z3_DOTNET_ASSEMBLY_OUTPUT_DIR TARGET libz3 PROPERTY LIBRARY_OUTPUT_DIRECTORY)
|
# use it. We also can't use ``$<TARGET_FILE_DIR:libz3>`` because the ``OUTPUT``
|
||||||
set(Z3_DOTNET_ASSEMBLY_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
# argument to ``add_custom_commands()`` won't accept it.
|
||||||
|
# See http://public.kitware.com/pipermail/cmake/2016-March/063101.html
|
||||||
|
#
|
||||||
|
# For now just output file to the root binary directory like the Python build
|
||||||
|
# system does and emit a warning when appropriate.
|
||||||
|
if (DEFINED CMAKE_CONFIGURATION_TYPES)
|
||||||
|
# Multi-configuration build (e.g. Visual Studio and Xcode).
|
||||||
|
message(WARNING "You are using a multi-configuration generator. The build rules for"
|
||||||
|
" the \".NET\" bindings currently do not emit files per configuration so previously"
|
||||||
|
" generated files for other configurations will be overwritten.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(Z3_DOTNET_ASSEMBLY_OUTPUT_DIR "${CMAKE_BINARY_DIR}")
|
||||||
set(Z3_DOTNET_ASSEMBLY_NAME "Microsoft.Z3.dll")
|
set(Z3_DOTNET_ASSEMBLY_NAME "Microsoft.Z3.dll")
|
||||||
set(Z3_DOTNET_ASSEMBLY_DLL "${Z3_DOTNET_ASSEMBLY_OUTPUT_DIR}/${Z3_DOTNET_ASSEMBLY_NAME}")
|
set(Z3_DOTNET_ASSEMBLY_DLL "${Z3_DOTNET_ASSEMBLY_OUTPUT_DIR}/${Z3_DOTNET_ASSEMBLY_NAME}")
|
||||||
# csc.exe doesn't work with UNIX style paths so convert to native path
|
# csc.exe doesn't work with UNIX style paths so convert to native path
|
||||||
|
@ -252,7 +264,9 @@ if (DOTNET_TOOLCHAIN_IS_MONO)
|
||||||
# to find the assembly
|
# to find the assembly
|
||||||
install(FILES "${Z3_DOTNET_PKGCONFIG_FILE}" DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}")
|
install(FILES "${Z3_DOTNET_PKGCONFIG_FILE}" DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}")
|
||||||
|
|
||||||
# Configure the install and uninstall scripts
|
# Configure the install and uninstall scripts.
|
||||||
|
# Note: If multi-configuration generator support is ever fixed then these
|
||||||
|
# scripts will be broken.
|
||||||
configure_file(cmake_install_gac.cmake.in cmake_install_gac.cmake @ONLY)
|
configure_file(cmake_install_gac.cmake.in cmake_install_gac.cmake @ONLY)
|
||||||
configure_file(cmake_uninstall_gac.cmake.in cmake_uninstall_gac.cmake @ONLY)
|
configure_file(cmake_uninstall_gac.cmake.in cmake_uninstall_gac.cmake @ONLY)
|
||||||
|
|
||||||
|
@ -268,9 +282,10 @@ if (DOTNET_TOOLCHAIN_IS_MONO)
|
||||||
add_dependencies(uninstall remove_dotnet_dll_from_gac)
|
add_dependencies(uninstall remove_dotnet_dll_from_gac)
|
||||||
|
|
||||||
elseif(DOTNET_TOOLCHAIN_IS_WINDOWS)
|
elseif(DOTNET_TOOLCHAIN_IS_WINDOWS)
|
||||||
# FIXME: This isn't implemented because I'm not sure how/if the assembly should
|
# Don't install Z3_DOTNET_ASSEMBLY_DLL into the gac. Instead just copy into
|
||||||
# be installed to the GAC.
|
# installation directory.
|
||||||
message(WARNING "Install of .NET bindings is not implemented for Windows")
|
install(FILES "${Z3_DOTNET_ASSEMBLY_DLL}" DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
install(FILES "${Z3_DOTNET_ASSEMBLY_DLL_DOC}" DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unknown .NET toolchain")
|
message(FATAL_ERROR "Unknown .NET toolchain")
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in a new issue