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

Replace build script with linkage attributes #29

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

complexspaces
Copy link
Contributor

This PR follows up ff1a6dd with a slight improvement.

Instead of needing a build script to be compiled and ran just to link against system-provided dynamic libraries, it is possible to use the link attribute instead. This has an identical end result to the previous solution since the linker flags are generated just the same, but without the maintenance and build-time downsides of a build script.

@DoumanAsh
Copy link
Owner

Thanks
This was the first thing I tried when I started removing winapi but I remember having difficulties with using just linkage attributes (that's why it was released as beta.1 rather than full version)
I need to re-check it again to make sure linkage attributes work

@complexspaces
Copy link
Contributor Author

FWIW, I tested this on Windows 10 and cargo test worked just fine. I commented out the build script and incrementally applied the linkage attributes per extern block, watching the number of unknown symbol errors go down until it successfully compiled, linked, and ran.

Obviously feel free to do your own testing, this is just what appeared to work for me.

@DoumanAsh DoumanAsh merged commit 0b38c6a into DoumanAsh:master Nov 22, 2023
1 check passed
@DoumanAsh
Copy link
Owner

Works without issue, thank you.
I will publish stable 5.0.0

@complexspaces complexspaces deleted the replace-build-linking branch November 22, 2023 21:02
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

Successfully merging this pull request may close these issues.

2 participants