Open Zymlex opened 3 years ago
I’ll just add that I experienced the same thing trying to build IUI for the first time on my Mac today; using this repo in Cargo.toml solved it for me as well.
cmake
, but that hasn't made it into a release yet. I suspect that installing cmake
would let you compile with the released version, but that's nearly 3 years old at this point, so it's probably a good idea to stick with using the git version.I get the same error if I try to use iui from GitHub as a dependency in another crate, but if I run cd libui-rs/iui; cargo build
it compiles without error.
If people are still interested in this, I just ran into a bunch of issues with the cmake
dependency, on Windows 10, and managed to solve them successfully. First, make sure that you install CMake and that it's version is no newer than 3.19. Second, make sure CMake is on your path. The installer can add it there, or you can set it manually. These two things should allow you to build iui
version 0.3.0 without problems.
In case anyone is wondering why CMake 3.19, here's an explanation. The build.rs
script in ui-sys
uses the cmake
crate incorrectly, by specifying an empty build target instead of calling no_build_target(true)
. This results in the command line option --target ""
being passed to CMake, which used to work fine with older CMake version. CMake 3.15 added support for multiple build targets, but empty build target still worked the same as omitting the --target
switch. Starting with CMake 3.20, specifying an empty target triggers the usage message, which breaks the ui-sys
build.
For what it's worth, I'm likely to have some free time from work soon and hopefully can take the time to fix the build script. Thank you all for this very useful discussion!
This still happens on Windows 10 with version 0.3. (trunk has some different issues with bindgen not finding clang so couldn't test that.) It's very unfortunate that this requires an outdated cmake version (I only have 3.22) and I don't want users of my project to have to apply these hacks in order to get IUI compiling.
Windows Server 2019