Need a way for corrosion to ignore CMAKE_C_COMPILER
and CMAKE_CXX_COMPILER
flags
#533
-
My use case requires that part of my project be compiled by
but this messes up compilation of the other part of the project that's built by rust, configured by corrosion (note that it's trying to use the
which ends up failing to find the necessary libraries. Is there any way to sidestep this problem? (It feels like I'd either have to fail the rust side compilation or the qt compilation) Edit: What I'm trying to achieve is, to keep using the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What corrosion does is instructing Probably you don't even need to choose a different linker though, I suspect you are just missing some linker arguments like |
Beta Was this translation helpful? Give feedback.
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 iscc
. You can explicitly set a different linker by callingcorrosion_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}