Skip to content

Commit

Permalink
cmake: Fix windows nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Oct 30, 2024
1 parent 5ef15a2 commit 38fa9a3
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 94 deletions.
16 changes: 11 additions & 5 deletions cmake/dotnet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -362,23 +362,29 @@ file(MAKE_DIRECTORY ${DOTNET_PACKAGES_DIR})
# *.csproj.in contains:
# CMake variable(s) (@PROJECT_NAME@) that configure_file() can manage and
# generator expression ($<TARGET_FILE:...>) that file(GENERATE) can manage.
set(is_windows "$<PLATFORM_ID:Windows>")
set(is_not_windows "$<NOT:$<PLATFORM_ID:Windows>>")

set(need_zlib_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_ZLIB}>>")
set(need_unix_zlib_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_ZLIB}>>")
set(need_windows_zlib_lib "$<AND:${is_windows},$<BOOL:${BUILD_ZLIB}>>")

set(need_absl_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_absl}>>")
set(need_unix_absl_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_absl}>>")
set(need_windows_absl_lib "$<AND:${is_windows},$<BOOL:${BUILD_absl}>>")

set(need_re2_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_re2}>>")
set(need_unix_re2_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_re2}>>")
set(need_windows_re2_lib "$<AND:${is_windows},$<BOOL:${BUILD_re2}>>")

set(need_protobuf_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Protobuf}>>")
set(need_unix_protobuf_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Protobuf}>>")
set(need_windows_protobuf_lib "$<AND:${is_windows},$<BOOL:${BUILD_Protobuf}>>")

set(need_coinutils_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_CoinUtils}>>")
set(need_osi_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Osi}>>")
set(need_clp_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Clp}>>")
set(need_cgl_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Cgl}>>")
set(need_cbc_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_Cbc}>>")

set(need_highs_lib "$<AND:${is_not_windows},$<BOOL:${BUILD_HIGHS}>>")
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>")

Expand Down
185 changes: 96 additions & 89 deletions ortools/dotnet/Google.OrTools.runtime.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,104 +27,111 @@
<Content Include="
$<TARGET_FILE:google-ortools-native>
$<@is_ortools_shared@:;$<TARGET_SONAME_FILE:ortools>>
$<@need_zlib_lib@:;$<TARGET_SONAME_FILE:ZLIB::ZLIB>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::base>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::bad_any_cast_impl>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::bad_optional_access>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::bad_variant_access>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::city>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::civil_time>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::cord>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::cord_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::cordz_functions>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::cordz_handle>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::cordz_info>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::crc32c>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::crc_cord_state>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::crc_cpu_detect>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::crc_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::debugging_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::decode_rust_punycode>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::demangle_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::demangle_rust>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::die_if_null>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::examine_stack>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::exponential_biased>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_commandlineflag>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_commandlineflag_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_config>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_marshalling>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_parse>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_private_handle_accessor>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_program_name>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_reflection>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_usage>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_usage_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::graphcycles_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::hash>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::hashtablez_sampler>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::int128>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::kernel_timeout_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::leak_check>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_entry>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_flags>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_globals>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_initialize>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_check_op>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_conditions>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_fnmatch>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_format>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_globals>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_log_sink_set>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_message>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_nullguard>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_proto>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_severity>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_sink>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::low_level_hash>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::malloc_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_distributions>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_platform>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_pool_urbg>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_randen>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_randen_hwaes>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_randen_hwaes_impl>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_randen_slow>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_seed_material>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_seed_gen_exception>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_seed_sequences>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::raw_hash_set>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::raw_logging_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::spinlock_wait>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::stacktrace>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::status>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::statusor>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::str_format_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::strerror>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::string_view>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::strings>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::strings_internal>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::symbolize>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::synchronization>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::throw_delegate>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::time>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::time_zone>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::utf8_for_code_point>>
$<@need_absl_lib@:;$<TARGET_SONAME_FILE:absl::vlog_config_internal>>

$<@need_re2_lib@:;$<TARGET_SONAME_FILE:re2::re2>>
$<@need_unix_zlib_lib@:;$<TARGET_SONAME_FILE:ZLIB::ZLIB>>
$<@need_windows_zlib_lib@:;$<TARGET_FILE:ZLIB::ZLIB>>

$<@need_protobuf_lib@:;$<TARGET_SONAME_FILE:protobuf::libprotobuf>>
$<@need_protobuf_lib@:;$<TARGET_SONAME_FILE:utf8_validity>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::base>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::bad_any_cast_impl>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::bad_optional_access>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::bad_variant_access>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::city>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::civil_time>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::cord>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::cord_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::cordz_functions>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::cordz_handle>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::cordz_info>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::crc32c>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::crc_cord_state>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::crc_cpu_detect>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::crc_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::debugging_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::decode_rust_punycode>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::demangle_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::demangle_rust>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::die_if_null>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::examine_stack>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::exponential_biased>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_commandlineflag>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_commandlineflag_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_config>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_marshalling>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_parse>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_private_handle_accessor>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_program_name>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_reflection>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_usage>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::flags_usage_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::graphcycles_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::hash>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::hashtablez_sampler>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::int128>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::kernel_timeout_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::leak_check>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_entry>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_flags>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_globals>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_initialize>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_check_op>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_conditions>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_fnmatch>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_format>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_globals>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_log_sink_set>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_message>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_nullguard>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_internal_proto>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_severity>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::log_sink>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::low_level_hash>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::malloc_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_distributions>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_platform>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_pool_urbg>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_randen>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_randen_hwaes>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_randen_hwaes_impl>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_randen_slow>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_internal_seed_material>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_seed_gen_exception>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::random_seed_sequences>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::raw_hash_set>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::raw_logging_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::spinlock_wait>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::stacktrace>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::status>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::statusor>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::str_format_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::strerror>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::string_view>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::strings>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::strings_internal>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::symbolize>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::synchronization>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::throw_delegate>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::time>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::time_zone>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::utf8_for_code_point>>
$<@need_unix_absl_lib@:;$<TARGET_SONAME_FILE:absl::vlog_config_internal>>
$<@need_windows_absl_lib@:;$<TARGET_FILE:absl::abseil_dll>>

$<@need_unix_re2_lib@:;$<TARGET_SONAME_FILE:re2::re2>>

$<@need_unix_protobuf_lib@:;$<TARGET_SONAME_FILE:protobuf::libprotobuf>>
$<@need_unix_protobuf_lib@:;$<TARGET_SONAME_FILE:utf8_validity>>
$<@need_windows_protobuf_lib@:;$<TARGET_FILE:protobuf::libprotobuf>>
$<@need_windows_protobuf_lib@:;$<TARGET_FILE:utf8_validity>>

$<@need_coinutils_lib@:;$<TARGET_SONAME_FILE:Coin::CoinUtils>>
$<@need_osi_lib@:;$<TARGET_SONAME_FILE:Coin::Osi>>
$<@need_clp_lib@:;$<TARGET_SONAME_FILE:Coin::Clp>;$<TARGET_SONAME_FILE:Coin::OsiClp>;$<TARGET_SONAME_FILE:Coin::ClpSolver>>
$<@need_cgl_lib@:;$<TARGET_SONAME_FILE:Coin::Cgl>>
$<@need_cbc_lib@:;$<TARGET_SONAME_FILE:Coin::Cbc>;$<TARGET_SONAME_FILE:Coin::OsiCbc>;$<TARGET_SONAME_FILE:Coin::CbcSolver>>

$<@need_highs_lib@:;$<TARGET_SONAME_FILE:highs>>
$<@need_unix_highs_lib@:;$<TARGET_SONAME_FILE:highs>>
$<@need_windows_highs_lib@:;$<TARGET_FILE:highs>>
">
<PackagePath>runtimes/@DOTNET_RID@/native/%(Filename)%(Extension)</PackagePath>
<Pack>true</Pack>
Expand Down

0 comments on commit 38fa9a3

Please sign in to comment.