diff --git a/build/rust/mozbuild/generate_buildconfig.py b/build/rust/mozbuild/generate_buildconfig.py index 4571db1ce0528d..2a3e6437154a34 100644 --- a/build/rust/mozbuild/generate_buildconfig.py +++ b/build/rust/mozbuild/generate_buildconfig.py @@ -123,3 +123,7 @@ def generate(output): output.write(generate_string_array("BINDGEN_SYSTEM_FLAGS")) output.write(generate_string_array("MOZ_GTK3_CFLAGS")) output.write(generate_string_array("MOZ_GTK3_LIBS")) + output.write(generate_string_array("NSPR_CFLAGS")) + output.write(generate_string_array("NSS_CFLAGS")) + output.write(generate_string_array("MOZ_PIXMAN_CFLAGS")) + output.write(generate_string_array("MOZ_ICU_CFLAGS")) diff --git a/js/moz.configure b/js/moz.configure index a8937364dae245..bae071ce50ca72 100644 --- a/js/moz.configure +++ b/js/moz.configure @@ -1207,7 +1207,7 @@ def in_tree_icu(system_icu): # Set MOZ_ICU_CFLAGS to an explicit empty value when --with-system-icu is *not* used, -# for layout/style/extra-bindgen-flags +# for use for bindgen through the mozbuild crate. set_config("MOZ_ICU_CFLAGS", [], when=in_tree_icu) set_config("MOZ_SYSTEM_ICU", True, when=system_icu) diff --git a/layout/style/extra-bindgen-flags.in b/layout/style/extra-bindgen-flags.in deleted file mode 100644 index 862f2f7c45fc2e..00000000000000 --- a/layout/style/extra-bindgen-flags.in +++ /dev/null @@ -1 +0,0 @@ -@BINDGEN_SYSTEM_FLAGS@ @NSPR_CFLAGS@ @MOZ_PIXMAN_CFLAGS@ @MOZ_ICU_CFLAGS@ diff --git a/layout/style/moz.build b/layout/style/moz.build index 4043ddd1ec7a8c..bda38a281da876 100644 --- a/layout/style/moz.build +++ b/layout/style/moz.build @@ -362,7 +362,3 @@ if CONFIG["COMPILE_ENVIRONMENT"]: "ServoStyleConsts.h", inputs=["/servo/ports/geckolib", "/servo/components/style"], ) - - CONFIGURE_SUBST_FILES += [ - "extra-bindgen-flags", - ] diff --git a/servo/components/style/build_gecko.rs b/servo/components/style/build_gecko.rs index 4cca741a9b8ad1..156ae50c742e3c 100644 --- a/servo/components/style/build_gecko.rs +++ b/servo/components/style/build_gecko.rs @@ -46,12 +46,12 @@ lazy_static! { read_config(&path) }; static ref BINDGEN_FLAGS: Vec = { - // Load build-specific config overrides. - let path = mozbuild::TOPOBJDIR.join("layout/style/extra-bindgen-flags"); - println!("cargo:rerun-if-changed={}", path.to_str().unwrap()); - fs::read_to_string(path).expect("Failed to read extra-bindgen-flags file") - .split_whitespace() - .map(std::borrow::ToOwned::to_owned) + mozbuild::config::BINDGEN_SYSTEM_FLAGS + .iter() + .chain(&mozbuild::config::NSPR_CFLAGS) + .chain(&mozbuild::config::MOZ_PIXMAN_CFLAGS) + .chain(&mozbuild::config::MOZ_ICU_CFLAGS) + .map(|s| s.to_string()) .collect() }; static ref INCLUDE_RE: Regex = Regex::new(r#"#include\s*"(.+?)""#).unwrap(); diff --git a/tools/profiler/moz.build b/tools/profiler/moz.build index 5a88f1a3beb418..80ea0855e7ac45 100644 --- a/tools/profiler/moz.build +++ b/tools/profiler/moz.build @@ -209,11 +209,6 @@ GeneratedFile( inputs=["../../mozglue/baseprofiler/build/profiling_categories.yaml"], ) -CONFIGURE_SUBST_FILES += [ - "rust-api/extra-bindgen-flags", -] - - if CONFIG["COMPILE_ENVIRONMENT"]: CbindgenHeader("profiler_ffi_generated.h", inputs=["rust-api"]) diff --git a/tools/profiler/rust-api/build.rs b/tools/profiler/rust-api/build.rs index a27e52d03cab1f..70e6096316ceb4 100644 --- a/tools/profiler/rust-api/build.rs +++ b/tools/profiler/rust-api/build.rs @@ -23,12 +23,10 @@ const BINDINGS_FILE: &str = "bindings.rs"; lazy_static! { static ref BINDGEN_FLAGS: Vec = { - // Load build-specific config overrides. - let path = mozbuild::TOPOBJDIR.join("tools/profiler/rust-api/extra-bindgen-flags"); - println!("cargo:rerun-if-changed={}", path.to_str().unwrap()); - fs::read_to_string(path).expect("Failed to read extra-bindgen-flags file") - .split_whitespace() - .map(std::borrow::ToOwned::to_owned) + mozbuild::config::BINDGEN_SYSTEM_FLAGS + .iter() + .chain(&mozbuild::config::NSPR_CFLAGS) + .map(|s| s.to_string()) .collect() }; static ref SEARCH_PATHS: Vec = vec![ diff --git a/tools/profiler/rust-api/extra-bindgen-flags.in b/tools/profiler/rust-api/extra-bindgen-flags.in deleted file mode 100644 index b0275a031bb372..00000000000000 --- a/tools/profiler/rust-api/extra-bindgen-flags.in +++ /dev/null @@ -1 +0,0 @@ -@BINDGEN_SYSTEM_FLAGS@ @NSPR_CFLAGS@