Skip to content

Need a way for corrosion to ignore CMAKE_C_COMPILER and CMAKE_CXX_COMPILER flags #533

Answered by jschwe
Billyzou0741326 asked this question in Q&A
Discussion options

You must be logged in to vote

What corrosion does is instructing rustc to use the same linker as CMake would choose. The default linker (or linker-driver) in rust depends on the target, but usually it is just whatever is cc. You can explicitly set a different linker by calling corrosion_set_linker (See also https://corrosion-rs.github.io/corrosion/usage.html#per-target-options).

Probably you don't even need to choose a different linker though, I suspect you are just missing some linker arguments like --sysroot=${CMAKE_SYSROOT}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Billyzou0741326
Comment options

Answer selected by Billyzou0741326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants