3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00

Revert "api: dotnet: switch to multi-targeting project and modern cmake-dotnet integration."

This commit is contained in:
Nikolaj Bjorner 2019-01-16 10:21:56 -08:00 committed by GitHub
parent 16c15d53a9
commit 038971c029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 645 additions and 740 deletions

View file

@ -112,10 +112,3 @@ set_target_properties(z3_tptp5 PROPERTIES EXCLUDE_FROM_ALL TRUE)
if (BUILD_PYTHON_BINDINGS)
add_subdirectory(python)
endif()
################################################################################
# Build dotnet examples
################################################################################
if (BUILD_DOTNET_BINDINGS)
add_subdirectory(dotnet)
endif()

View file

@ -1,34 +0,0 @@
find_package(Dotnet REQUIRED)
if("${TARGET_ARCHITECTURE}" STREQUAL "i686")
set(Z3_DOTNET_PLATFORM "x86")
else()
set(Z3_DOTNET_PLATFORM "AnyCPU")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dotnet.csproj dotnet.csproj COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Program.cs Program.cs COPYONLY)
ADD_DOTNET(${CMAKE_CURRENT_BINARY_DIR}/dotnet.csproj
PLATFORM ${Z3_DOTNET_PLATFORM}
NETCOREAPP
CUSTOM_BUILDPROPS "<Z3_VERSION>${Z3_VERSION_MAJOR}.${Z3_VERSION_MINOR}.${Z3_VERSION_PATCH}</Z3_VERSION>"
DEPENDS Microsoft.Z3)
if(UNIX AND NOT APPLE)
set(z3_dotnet_native_lib ${CMAKE_BINARY_DIR}/libz3.so)
set(z3_dotnet_test_manual_copy_deps
${CMAKE_BINARY_DIR}/Microsoft.Z3/netstandard2.0/Microsoft.Z3.dll
${z3_dotnet_native_lib}
)
add_custom_target(
z3_dotnet_test_manual_copy_assembly_hack ALL
COMMAND ${CMAKE_COMMAND} -E copy ${z3_dotnet_test_manual_copy_deps} ${CMAKE_BINARY_DIR}/dotnet/netcoreapp2.0/
# hack the libz3 entry in deps so it's easy enough for dotnet to reach it...
COMMAND sed \"s/runtimes\\/.*libz3\\.so/libz3.so/\" -i ${CMAKE_BINARY_DIR}/dotnet/netcoreapp2.0/dotnet.deps.json
)
add_dependencies(z3_dotnet_test_manual_copy_assembly_hack BUILD_dotnet)
endif()

View file

@ -1,6 +1,7 @@
Small example using the .Net bindings.
This example is only built if you have Visual Studio.
To build the example execute
make examples
in the build directory.
It will create a .net core 2.0 app.
It will create the executable dotnet_example.exe

View file

@ -1,12 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Z3" Version="$(Z3_VERSION)" />
</ItemGroup>
</Project>