skip macos

This commit is contained in:
Fabian-Lars committed 2026-04-13 17:03:33 +02:00
1 parent 0c840700ca
commit 7fc79c7aa4
1 file changed
+29 -20
+29 -20
View File
@@ -112,17 +112,13 @@ fn main() -> anyhow::Result<()> {
.parent()
.unwrap();
// On Windows and Linux the cef files usually have to be next to the main binary.
// TODO: Consider to put this behind a feature flag
copy_cef_runtime_files(&cef_dir, target_dir)?;
let cef_dir = cef_dir.to_string_lossy().into_owned();
let cef_dir_str = cef_dir.to_string_lossy().into_owned();
// Re-run when the resolved CEF directory changes/deletes.
println!("cargo::rerun-if-changed={cef_dir}");
println!("cargo::rerun-if-changed={cef_dir_str}");
println!("cargo::metadata=CEF_DIR={cef_dir}");
println!("cargo::rustc-link-search=native={cef_dir}");
println!("cargo::metadata=CEF_DIR={cef_dir_str}");
println!("cargo::rustc-link-search=native={cef_dir_str}");
let mut cef_dll_wrapper = cmake::Config::new(&cef_dir);
cef_dll_wrapper
@@ -143,9 +139,19 @@ fn main() -> anyhow::Result<()> {
match os_arch.os {
"linux" => {
// On Windows and Linux the cef files usually have to be next to the main binary.
// On macOS it's more complicated so we'll leave it to tools like tauri-cli for now.
// TODO: Consider to put this behind a feature flag
copy_cef_runtime_files(&cef_dir, target_dir)?;
println!("cargo::rustc-link-lib=dylib=cef");
}
"windows" => {
// On Windows and Linux the cef files usually have to be next to the main binary.
// On macOS it's more complicated so we'll leave it to tools like tauri-cli for now.
// TODO: Consider to put this behind a feature flag
copy_cef_runtime_files(&cef_dir, target_dir)?;
let sdk_libs = [
"comctl32.lib",
"delayimp.lib",
@@ -200,24 +206,27 @@ fn main() -> anyhow::Result<()> {
#[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)?;
for entry in std::fs::read_dir(src)? {
let entry = entry?;
if entry.path().is_file() {
std::fs::copy(entry.path(), dest.join(entry.file_name()))?;
std::fs::create_dir_all(dest)?;
for entry in std::fs::read_dir(src)? {
let entry = entry?;
if entry.path().is_file() {
std::fs::copy(entry.path(), dest.join(entry.file_name()))?;
}
}
}
Ok(())
Ok(())
}
#[cfg(not(feature = "dox"))]
fn copy_cef_runtime_files(cef_dir: &std::path::Path, target_dir: &std::path::Path) -> Result<(), std::io::Error> {
copy_directory(cef_dir, target_dir)?;
fn copy_cef_runtime_files(
cef_dir: &std::path::Path,
target_dir: &std::path::Path,
) -> Result<(), std::io::Error> {
copy_directory(cef_dir, target_dir)?;
const LOCALES_DIR: &str = "locales";
copy_directory(&cef_dir.join(LOCALES_DIR), &target_dir.join(LOCALES_DIR))?;
const LOCALES_DIR: &str = "locales";
copy_directory(&cef_dir.join(LOCALES_DIR), &target_dir.join(LOCALES_DIR))?;
Ok(())
Ok(())
}
#[cfg(feature = "dox")]