Skip to content
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

How do I force static monolith linking? #18

Open
SeanTolstoyevski opened this issue Jan 23, 2022 · 1 comment
Open

How do I force static monolith linking? #18

SeanTolstoyevski opened this issue Jan 23, 2022 · 1 comment

Comments

@SeanTolstoyevski
Copy link

Hi,
Since I'm a Windows user, I don't want to mess with dll's.
Instead I created the allegro as a monolith.
Now how can I tell Rust to use this library?

@SiegeLord
Copy link
Owner

SiegeLord commented Jan 23, 2022

This wrapper doesn't have this feature built-in (I suppose it could be), but you can specify the link_none feature (see https://doc.rust-lang.org/cargo/reference/features.html#dependency-features) and then add a build.rs script to your crate with something like this in it:

fn main() {
    println!("cargo:rustc-link-lib=-l allegro_monolith_static");
    println!("cargo:rustc-link-search=-L DIRECTORY_WITH_LIBRARY");
}

Note that you'll need to also specify a whole bunch of system libraries (all the ones here and here] to link to as well using the same mechanism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants