diff --git a/crates/cxx-qt-build/src/lib.rs b/crates/cxx-qt-build/src/lib.rs index b9374f74a..0ef15742a 100644 --- a/crates/cxx-qt-build/src/lib.rs +++ b/crates/cxx-qt-build/src/lib.rs @@ -553,9 +553,7 @@ impl CxxQtBuilder { builder.define(extra_define, None); } - for include_dir in qtbuild.include_paths() { - builder.include(&include_dir); - } + builder.includes(qtbuild.include_paths()); builder.include(&header_root); builder.include(&generated_header_dir); } diff --git a/crates/cxx-qt-lib/Cargo.toml b/crates/cxx-qt-lib/Cargo.toml index 3dd929912..0ccdb1b93 100644 --- a/crates/cxx-qt-lib/Cargo.toml +++ b/crates/cxx-qt-lib/Cargo.toml @@ -11,9 +11,6 @@ edition.workspace = true license.workspace = true description = "Qt types for integrating `cxx-qt` crate with `cxx`" repository.workspace = true -# Fake linking so that we expose cargo data as env vars for downstream crates -# https://github.com/rust-lang/cargo/issues/3544 -links = "cxx-qt-lib" exclude = [ "**/generate.sh" ] [dependencies] diff --git a/crates/cxx-qt-lib/build.rs b/crates/cxx-qt-lib/build.rs index 940e1d82b..18d284a83 100644 --- a/crates/cxx-qt-lib/build.rs +++ b/crates/cxx-qt-lib/build.rs @@ -194,12 +194,6 @@ fn main() { println!("cargo:rerun-if-changed=src/{bridge}.rs"); } - for include_path in qtbuild.include_paths() { - cxx_build::CFG - .exported_header_dirs - .push(include_path.as_path()); - } - let mut builder = cxx_build::bridges(rust_bridges.iter().map(|bridge| format!("src/{bridge}.rs"))); @@ -282,6 +276,11 @@ fn main() { let mut header = File::create(h_path).expect("Could not create header: {h_path}"); write!(header, "{file_contents}").expect("Could not write header: {h_path}"); } + + // Load the include paths + // + // TODO: note once we use cxx-qt-build we don't need to include the Qt paths here + builder.includes(qtbuild.include_paths()); builder.include(header_root); // Enable Qt Gui in C++ if the feature is enabled