Crates.io | wx-rs |
lib.rs | wx-rs |
version | 0.2.0 |
source | src |
created_at | 2023-03-26 19:14:16.723065 |
updated_at | 2023-04-04 04:33:05.147368 |
description | Self-contained wxWidgets in Rust. |
homepage | |
repository | https://github.com/AlexCharlton/wx-rs |
max_upload_size | |
id | 821492 |
size | 86,414 |
This is an alpha release. Don't expect much from me.
Only builds on the MSVC toolchain right now
An extremely partial set of bindings to wxWidgets, for Rust. The intent is that you can import this and all the bits of wxWidgets provided are statically linked in. Implements HasRawWindowHandle
. Callbacks are used for rendering and event handling. Features:
Some things that'd be great to have:
The build script has only been tested on MSVC. Previously I've gotten this to compile on OSX and Windows with the GNU toolchain. There's no reason why this can't work on Linux as well.
Icon support for Windows/Linux
The approach this crate takes is to download wxWidgets into the ./dist
directory, then build it. This means that you need to have a toolchain capable of compiling wxWidgets.
Why are we doing this instead of using submodules? Because with submodules cargo would naturally check out files, but this isn't desirable since we want cargo to ignore these files when packaging (because wxWidgets is huge: The package, when you trim out all non-source files is still around 100MB).
Why do we save/compile to dist
rather than cargo's preferred OUT_DIR
? Because with the latter, we'd have to recompile wxWidgets more frequently. Since it takes quite a while to do so, it's much nicer to only have to compile once and then have the artifact around forever.
If you want to do a fresh install, just rm -R ./dist
.
Make sure you're using ""x64 Native Tools Command Prompt for VS 2019"", and that cargo is in your path when compiling for the first time. After it's built, msys works fine to continue building things from the Rust side.
This depends on nightly rust to build correctly
$ pacman -Syu
$ pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-libexpat mingw-w64-x86_64-zlib msys2-w32api-runtime pacman -S mingw-w64-x86_64-lld
This is a note of what needs to be integrated into the build script.
In a MSYS2 MinGW64 terminal:
$ cd dist/wxWidgets
$ mkdir msw64-release-build
$ ../configure --with-opengl --disable-shared
$ make -j20
... why aren't I documented? :(