Merge branch 'dev' into feat/cross-compile-windows

This commit is contained in:
Lucas Nogueira committed 2026-09-04 21:38:26 -03:00
commit ef243a34e1
3 files changed
+48 -3

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@ members = [
]
[workspace.package]
version = "151.8.0+151.3.24"
version = "151.8.1+151.3.24"
edition = "2021"
license = "Apache-2.0 OR MIT"
authors = [
@@ -24,7 +24,7 @@ repository = "https://github.com/tauri-apps/cef-rs"
[workspace.dependencies]
cef = { path = "cef", default-features = false }
cef-dll-sys = { version = "151.8.0", path = "sys" }
cef-dll-sys = { version = "151.8.1", path = "sys" }
download-cef = { version = "2.3", path = "download-cef" }
anyhow = "1"
+6
View File
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [151.8.1+151.3.24](https://github.com/tauri-apps/cef-rs/compare/cef-dll-sys-v151.8.0+151.3.24...cef-dll-sys-v151.8.1+151.3.24) - 2026-09-03
### Fixed
- explicit API version for wrapper
## [151.5.0+151.3.17](https://github.com/tauri-apps/cef-rs/compare/cef-dll-sys-v151.4.0+151.3.17...cef-dll-sys-v151.5.0+151.3.17) - 2026-08-15
### Added
+40 -1
View File
@@ -120,11 +120,29 @@ fn main() -> anyhow::Result<()> {
println!("cargo::metadata=CEF_DIR={cef_dir_str}");
println!("cargo::rustc-link-search=native={cef_dir_str}");
// Compile the wrapper against an explicit API version instead of the
// experimental (unversioned) API that CEF selects by default, which its
// own headers call "not back/forward compatible with different CEF
// versions". It is the version the crate declares at run time through
// `cef_api_hash(CEF_API_VERSION_LAST)`, so the two now agree; without it
// the macOS loader in `libcef_dll_dylib.cc` also resolves experimental
// entry points, and loading any libcef but this exact build fails on the
// first one missing.
let api_version = cef_api_version_last(&cef_dir)?;
println!("cargo::metadata=CEF_API_VERSION={api_version}");
let mut cef_dll_wrapper = cmake::Config::new(&cef_dir);
cef_dll_wrapper
.generator("Ninja")
.profile("RelWithDebInfo")
.build_target("libcef_dll_wrapper");
.build_target("libcef_dll_wrapper")
// Seeds the list CEF's cmake appends its own defines to and applies
// to the target; CMAKE_CXX_FLAGS would not survive, cef_variables
// clears it for the Ninja generator on Windows.
.define(
"CEF_COMPILER_DEFINES",
format!("CEF_API_VERSION={api_version}"),
);
let project_arch = match os_arch.arch {
"aarch64" => "arm64",
@@ -354,6 +372,27 @@ fn find_case_insensitive(dir: &std::path::Path, name: &str) -> Option<std::path:
})
}
/// `CEF_API_VERSION_LAST` from the distribution's generated
/// `include/cef_api_versions.h`: the newest versioned (non-experimental) API
/// it supports, written there as `#define CEF_API_VERSION_LAST
/// CEF_API_VERSION_15101`.
#[cfg(not(feature = "dox"))]
fn cef_api_version_last(cef_dir: &std::path::Path) -> anyhow::Result<u32> {
let header = cef_dir.join("include").join("cef_api_versions.h");
let contents = std::fs::read_to_string(&header)?;
contents
.lines()
.find_map(|line| {
line.strip_prefix("#define CEF_API_VERSION_LAST ")?
.trim()
.strip_prefix("CEF_API_VERSION_")?
.parse()
.ok()
})
.ok_or_else(|| anyhow::anyhow!("no CEF_API_VERSION_LAST in {}", header.display()))
}
#[cfg(not(feature = "dox"))]
fn copy_directory(src: &std::path::Path, dest: &std::path::Path) -> Result<(), std::io::Error> {
std::fs::create_dir_all(dest)?;