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

Use binary crate #90

Merged
merged 21 commits into from
Jul 3, 2022
Merged

Use binary crate #90

merged 21 commits into from
Jul 3, 2022

Conversation

kenz-gelsoft
Copy link
Owner

@kenz-gelsoft kenz-gelsoft commented Jun 21, 2022

  • cargo build --features vendored builds with prebiult repo's wx binary if specified for that target.
  • doesn't link currently Now it builds and run locally with help from @ancwrd1.
  • Adding GitHub Actions for these configuration will be another Issue and PR,

@kenz-gelsoft
Copy link
Owner Author

kenz-gelsoft commented Jul 2, 2022

@ancwrd1 I think with this PR, you can use your vendored repo with --features use_binary flag.

And also it is able to use another binary crate by overriding concrete crates in consumer project's cargo configuration like:

[dependencies]
wx-x86_64-pc-windows-gnu = { git = "another/git/repo" }

This will support your suggested use case in #72? Any other feedbacks? (Better name or specification of feature is welcome!)

Thanks in advance.

wx-core/Cargo.toml Outdated Show resolved Hide resolved
wx-base/Cargo.toml Show resolved Hide resolved
@ancwrd1
Copy link

ancwrd1 commented Jul 2, 2022

Thanks for your work! I think the common feature name used by many popular crates is 'vendored' (or like 'vendored-wx', etc). For example it is used in native-tls, openssl, reqwest. But it's not too important.
I see that you have also added -msvc based binaries, that's nice! I will try it.

@kenz-gelsoft
Copy link
Owner Author

kenz-gelsoft commented Jul 2, 2022

I think the common feature name used by many popular crates is 'vendored' (or like 'vendored-wx', etc).

OK, to rename to that.

I see that you have also added -msvc based binaries, that's nice! I will try it.

I'm afraid that it is not what you expected. The -msvc binary is wxWidgets official DLL distribution for MSVC which packaged in compatible way with your prebuilt crates. So, they are not static linked and requires you place DLLs in same directory of executables manually (at least, for now).

At first, I made this target specific dependency to test overriding dependency, But -msvc and -gnu are different targets and cant have the same name by renaming. So not worked for this purpuse.

I don't remove this because this is convenient to test just if it's build or not. (I'll add GitHub Action for this in another PR.)

It's not hard to copy corresponding DLLs from -msvc to target build directory. I'll work on this in part of #34.

@kenz-gelsoft kenz-gelsoft marked this pull request as ready for review July 3, 2022 03:16
@kenz-gelsoft kenz-gelsoft merged commit 48c223a into main Jul 3, 2022
@kenz-gelsoft kenz-gelsoft changed the title WIP: Use binary crate Use binary crate Jul 3, 2022
@kenz-gelsoft kenz-gelsoft deleted the use_binary_crate branch July 3, 2022 03:29
@ancwrd1
Copy link

ancwrd1 commented Jul 14, 2022

I'm afraid that it is not what you expected. The -msvc binary is wxWidgets official DLL distribution for MSVC which packaged in compatible way with your prebuilt crates. So, they are not static linked and requires you place DLLs in same directory of executables manually (at least, for now).

I've now added static manually built lean and mean MSVC repo as well:
https://github.com/ancwrd1/wx-x86_64-pc-windows-msvc.git

The following flags are needed for compilation: /std:c++14, /EHsc
/D_CRT_SECURE_NO_WARNINGS can be also specified to avoid warnings.

@kenz-gelsoft
Copy link
Owner Author

@ancwrd1 Thank you for providing static prebuilt crate.

I'll utilize that when I'll start writing unit tests for windows in future.

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