mirror of
https://github.com/tauri-apps/cef-rs.git
synced 2026-01-31 00:55:21 +01:00
feat: unify bundle utilities under cef build-util feature feat: reenable sandbox support in cefsimple feat: add MainMenu.xib on mac fix: bypass tryToTerminateApplication for Command+Q fix: enable much smaller linux release builds
1.7 KiB
1.7 KiB
cef-rs
Use CEF in Rust.
Supported Targets
| Target | Linux | macOS | Windows |
|---|---|---|---|
| x86_64 | ✅ | ✅ | ✅ |
| ARM64 | ✅ | ✅ | ✅ |
Usage
Install Shared CEF Binaries
This step is optional, but it will make all other builds of the cef crate much faster. If you don't do this, the cef-dll-sys crate build.rs script will download and extract the same files under its OUT_DIR directory. You should repeat this step each time you upgrade to a new version of the cef crate.
Linux or macOS:
cargo run -p export-cef-dir -- --force $HOME/.local/share/cef
Windows (using PowerShell)
cargo run -p export-cef-dir -- --force $env:USERPROFILE/.local/share/cef
Set Environment Variables
Linux
export CEF_PATH="$HOME/.local/share/cef"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CEF_PATH"
macOS
export CEF_PATH="$HOME/.local/share/cef"
export DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH:$CEF_PATH:$CEF_PATH/Chromium Embedded Framework.framework/Libraries"
Windows (using PowerShell)
$env:CEF_PATH="$env:USERPROFILE/.local/share/cef"
$env:PATH="$env:PATH;$env:CEF_PATH"
Run the cefsimple Example
This command should work with each platform:
cargo run --bin bundle-cef-app -- cefsimple -o target/bundle
Linux
cargo run --bin cefsimple
macOS
cargo run --bin bundle-cef-app -- cefsimple -o target/bundle
open target/bundle/cefsimple.app
Windows (using PowerShell)
cargo run --bin bundle-cef-app -- cefsimple -o ./target/bundle
./target/bundle/cefsimple.exe
Contributing
Please see CONTRIBUTING.md for details.