Skip to content

Commit

Permalink
Fix build with MSVC and rustc 1.79
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Jun 17, 2024
1 parent 5ebb12f commit 29bcd93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions metatensor-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ if (CARGO_VERSION_CHANGED)

# Special case `msvcrt` to link with the debug version in Debug mode.
list(TRANSFORM stripped_lib_list REPLACE "^msvcrt$" "\$<\$<CONFIG:Debug>:msvcrtd>")
# Don't try to pass a linker *flag* where CMake expects libraries
list(REMOVE_ITEM stripped_lib_list "/defaultlib:msvcrt")

if (APPLE)
# Prevent warnings about duplicated `System` in linked libraries
Expand All @@ -229,9 +231,9 @@ if (CARGO_VERSION_CHANGED)
list(REMOVE_DUPLICATES stripped_lib_list)
set(CARGO_DEFAULT_LIBRARIES "${stripped_lib_list}" CACHE INTERNAL "list of implicitly linked libraries")

if (${METATENSOR_MAIN_PROJECT})
# if (${METATENSOR_MAIN_PROJECT})
message(STATUS "Cargo default link libraries are: ${CARGO_DEFAULT_LIBRARIES}")
endif()
# endif()
else()
message(FATAL_ERROR "could not find default static libs: `native-static-libs` not found in: `${cargo_static_libs_stderr}`")
endif()
Expand Down

0 comments on commit 29bcd93

Please sign in to comment.