Skip to content

Commit ee6c8cc

Browse files
committed
dotnet: Fix MSVC shared libs support
1 parent 51b55aa commit ee6c8cc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cmake/dotnet.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ set(need_unix_highs_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_HIGHS}>>")
395395
set(need_windows_highs_lib "$<AND:${is_windows},$<BOOL:${BUILD_HIGHS}>>")
396396

397397
set(is_ortools_shared "$<STREQUAL:$<TARGET_PROPERTY:ortools,TYPE>,SHARED_LIBRARY>")
398+
set(need_unix_ortools_lib "$<AND:${is_not_windows},${is_ortools_shared}>")
399+
set(need_windows_ortools_lib "$<AND:${is_windows},${is_ortools_shared}>")
398400

399401
configure_file(
400402
${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_PACKAGE}.runtime.csproj.in

ortools/dotnet/Google.OrTools.runtime.csproj.in

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
<!-- If ortools is built as a STATIC_LIBRARY (e.g. Windows) then we don't have to include it -->
2727
<Content Include="
2828
$<TARGET_FILE:google-ortools-native>
29-
$<@is_ortools_shared@:;$<TARGET_SONAME_FILE:ortools>>
30-
3129
$<@need_unix_zlib_lib@:;$<TARGET_SONAME_FILE:ZLIB::ZLIB>>
3230
$<@need_windows_zlib_lib@:;$<TARGET_FILE:ZLIB::ZLIB>>
3331

@@ -133,6 +131,9 @@
133131

134132
$<@need_unix_highs_lib@:;$<TARGET_SONAME_FILE:highs>>
135133
$<@need_windows_highs_lib@:;$<TARGET_FILE:highs>>
134+
135+
$<@need_unix_ortools_lib@:;$<TARGET_SONAME_FILE:ortools>>
136+
$<@need_windows_ortools_lib@:;$<TARGET_FILE:ortools>>
136137
">
137138
<PackagePath>runtimes/@DOTNET_RID@/native/%(Filename)%(Extension)</PackagePath>
138139
<Pack>true</Pack>

0 commit comments

Comments
 (0)