kenz-gelsoft / wxRust2

re-exploration Rust binding to wx
MIT License
78 stars 10 forks source link

Use binary crate #90

Closed kenz-gelsoft closed 2 years ago

kenz-gelsoft commented 2 years ago
kenz-gelsoft commented 2 years ago

@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.

ancwrd1 commented 2 years ago

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 commented 2 years ago

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.

ancwrd1 commented 2 years ago

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 commented 2 years ago

@ancwrd1 Thank you for providing static prebuilt crate.

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