我已经rustup-init.exe
在我的 PC (Windows 10 Pro) 上安装了 Rust,然后安装了 Microsoft Visual C++ Build Tools 2017,并带有用于 CMake 选项的 Visual C++ 工具。
举个简单的例子,没有问题:
fn main() {
println!("Hello world!");
}
我执行cargo run
命令,结果我得到Hello world!
了预期的结果。
但现在我想看看Azul GUI 框架
main.rs
extern crate azul;
fn main() {
println!("Hello world!");
}
货运.toml
[package]
name = "my_first_azul_app"
version = "0.1.0"
authors = ["Author"]
edition = "2018"
[dependencies]
azul = { git = "https://github.com/maps4print/azul" }
当我执行cargo run
命令时发生错误:
...
error: failed to run custom build command for `harfbuzz-sys v0.3.0 (https://github.com/maps4print/azul-dependencies?rev=c1548977fb62399f39aa642d2e7e24a24a25246e#c1548977)`
process didn't exit successfully: `C:\Users\admin\Documents\Rust\Projects\my_first_azul_app\target\debug\build\harfbuzz-sys-37196527d1c78dd0\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=HARFBUZZ_SYS_NO_PKG_CONFIG
running: "cmake" "C:\\Users\\admin\\.cargo\\git\\checkouts\\azul-dependencies-70bb1f94316762f9\\c154897\\harfbuzz-sys-0.3.0\\harfbuzz" "-G" "Visual Studio 15 2017 Win64" "-Thost=x64" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\admin\\Documents\\Rust\\Projects\\my_first_azul_app\\target\\debug\\build\\harfbuzz-sys-9193f770b45e8642\\out" "-DCMAKE_C_FLAGS= /nologo /MD" "-DCMAKE_C_FLAGS_DEBUG= /nologo /MD" "-DCMAKE_CXX_FLAGS= /nologo /MD" "-DCMAKE_CXX_FLAGS_DEBUG= /nologo /MD" "-DCMAKE_BUILD_TYPE=Debug"
--- stderr
thread 'main' panicked at '
failed to execute command: cannot find the file specified. (os error 2)
is `cmake` not installed?
...
如何用 CMake 和 Rust 解决这个问题?我应该指定 CMake 路径吗?