-
-
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
Parse the native staticlib dependencies output from rustc #335
Comments
An intermediate solution was merged in #362, which parses the required libraries at configure time from a dummy demo project for the target arch. |
The other thing i'm trying to do is to link a staticlib that itself uses some shared library. So the build.rs of a dependency might do println!("cargo:rustc-link-search={foolib_path}");
println!("cargo:rustc-link-lib=foo"); And that information is also conveyed by I've tried to add the |
We don't, since we get that information only at build time. CMake itself does not support dynamic dependencies. What we could however do, is the following:
|
Does that mean we wouldn't see the progress output anymore in the console. I mean stuff like
Is there a way to use
Ah, clever! |
CMake >= 3.18 adds
The file path would need to be a parameter passed from corrosion to the CMake script we invoke. It would be a path in build directory, unique per target.
I hadn't thought about that yet! I haven't really looked at the install step of corrosion yet, but since there is #64, I'm guessing install for libraries is not implemented by corrosion at all yet, and left up to the user for now. |
I could work on implementing this.
Any update on these release plans 3 weeks later? I am surprised you are still supporting more than the most recent Ubuntu LTS. I suppose |
That would be a great help! I probably won’t have any time this month to work on this.
I'm planning on releasing current master as v0.4-alpha1 (this week hopefully), hope that people will test and then release it as v0.4 (approx. +2 weeks after alpha1).
There are still a surprising amount of people on "old" CMake / Ubuntu versions. I'd like to keep the hurdle of incrementally adopting Rust low and that should mean Corrosion doesn't require upgrading CMake / ubuntu. |
Thank you for supporting these, I have a corrosion using project which is still stuck supporting "old" (but at this time still supported) LTS versions, which is counting the days until these sunset. But until then, I have very much appreciated that support for these older builds has been kept intact. |
Currently, corrosion hardcodes the libraries required by Rust static libs (OS-dependent).
This list may not be always up-to-date and cover all required libraries, since the exact list may change between different rust versions, and additional libraries may be added by
#[link]
attributes in user code or from build scripts!Getting this information requires actually building the crate (with
--print=native-static-libs
) and all its dependencies.Probably the only way to pass these dependencies from the rustc output at build-time to the CMake linker command line would be by saving the required arguments to a response file, which clang/gcc support loading via
@file
. I think MSVC also has such an option.The text was updated successfully, but these errors were encountered: