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:
Mizux Seiha
2025-02-04 19:42:22 +01:00
parent 998314a9db
commit d3af4d76c9
38 changed files with 194 additions and 105 deletions

View File

@@ -55,11 +55,11 @@ def _load_ortools_libs():
except:
pass
else:
for dll in ["zlib1.dll", "abseil_dll.dll", "utf8_validity.dll", "libprotobuf.dll", "highs.dll"]:
dll_path = os.path.join(basedir, ".libs", dll)
if os.path.exists(dll_path):
print(f"load {dll_path}...")
WinDLL(dll_path)
for dll in ["zlib1.dll", "abseil_dll.dll", "utf8_validity.dll", "re2.dll", "libprotobuf.dll", "highs.dll", "ortools.dll"]:
dll_path = os.path.join(basedir, ".libs", dll)
if os.path.exists(dll_path):
print(f"load {dll_path}...")
WinDLL(dll_path)
_load_ortools_libs()
_load_ortools_libs()

View File

@@ -51,8 +51,7 @@ setup(
],
package_data={
'@PYTHON_PROJECT@':[
'.libs/*',
$<$<STREQUAL:$<TARGET_PROPERTY:@PROJECT_NAME@,TYPE>,SHARED_LIBRARY>:'../$<TARGET_SONAME_FILE_NAME:@PROJECT_NAME@>'>
'.libs/*'
],
'@PYTHON_PROJECT@.init.python':[
'$<TARGET_FILE_NAME:init_pybind11>',