Skip to content

Commit

Permalink
Don't set AR for msvc targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwe committed Nov 19, 2023
1 parent 42270de commit 03e4617
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/Corrosion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,9 @@ function(_add_cargo_build out_cargo_build_out_dir)
if(CMAKE_CXX_COMPILER)
list(APPEND corrosion_cc_rs_flags "CXX_${_CORROSION_RUST_CARGO_TARGET_UNDERSCORE}=${CMAKE_CXX_COMPILER}")
endif()
if(CMAKE_AR)
# cc-rs doesn't seem to support `llvm-ar` (commandline syntax), wo we might as well just use
# the default AR.
if(CMAKE_AR AND NOT (Rust_CARGO_TARGET_ENV STREQUAL "msvc"))
list(APPEND corrosion_cc_rs_flags "AR_${_CORROSION_RUST_CARGO_TARGET_UNDERSCORE}=${CMAKE_AR}")
endif()

Expand Down

0 comments on commit 03e4617

Please sign in to comment.