cmake: Fix and enabled shared lib support with MSVC

* Add decldll to proto
* rework init to make it working for MSVC
* fix test_xprs_interface build
dotnet: Fix MSVC shared libs support
  * Fix csproj to include libortools.dll
java: Fix MSVC shared_libs support
  * Fix runtime jar to include libortools.dll
python: Fix MSVC shared_libs support
  * fix __init__.py.in loading for MSVC
This commit is contained in:
Corentin Le Molgat
2025-01-27 02:01:03 -08:00
committed by Mizux Seiha
parent befa5f7a4f
commit da058cd01b
36 changed files with 189 additions and 100 deletions

View File

@@ -31,6 +31,7 @@ include(UseSWIG)
if(UNIX AND NOT APPLE)
list(APPEND CMAKE_SWIG_FLAGS "-DSWIGWORDSIZE64")
endif()
list(APPEND CMAKE_SWIG_FLAGS "-DOR_DLL=")
# Find dotnet cli
find_program(DOTNET_EXECUTABLE NAMES dotnet)
@@ -395,6 +396,8 @@ set(need_unix_highs_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_HIGHS}>>")
set(need_windows_highs_lib "$<AND:${is_windows},$<BOOL:${BUILD_HIGHS}>>")
set(is_ortools_shared "$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>")
set(need_unix_ortools_lib "$<AND:${is_not_windows},${is_ortools_shared}>")
set(need_windows_ortools_lib "$<AND:${is_windows},${is_ortools_shared}>")
configure_file(
${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_PACKAGE}.runtime.csproj.in