-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Propagate rustc native-static-libs to CMake #472
base: master
Are you sure you want to change the base?
Conversation
94a9196
to
b6b4ad6
Compare
status: Update: Well, I guess debugging this issue would have been much faster if I had thought of looking at the raw github logs instead of the default rendered version. Turns out that in CI the github action for installing rust, set an environment variable for Now the remaning issues are:
Overall it all seems a bit fragile, so most likely this will only be an optional feature. |
8a1e42f
to
0e6b78f
Compare
CMake usually requires all libraries required for linking to be specified at CMake configure time. However, in Rust native dependencies may be specified inside the source code via the [`link`] attribute. `rustc` can be instructed to print all required native libraries at build time, however this is already after the CMake configure stage has finished. To work around this we wrap the build command for Rust static libraries in a wrapper script, that parses the required libraries from the `rustc` output and writes them into an `rsp` file. At configure time we can then instruct CMake to read the linker arguments from the file that our wrapper will generate later at build time. [`link`]: https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute
90b288b
to
0cbe37f
Compare
CMake usually requires all libraries required for linking to be
specified at CMake configure time. However, in Rust native dependencies
may be specified inside the source code via the
link
attribute.rustc
can be instructed to print all required native libraries atbuild time, however this is already after the CMake configure stage
has finished. To work around this we wrap the build command for Rust
static libraries in a wrapper script, that parses the required libraries
from the
rustc
output and writes them into anrsp
file.At configure time we can then instruct CMake to read the linker
arguments from the file that our wrapper will generate later at build
time.
Closes #335