From f1be3a0d4d2df6497d46f627cc54ce8450da8699 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sun, 5 Dec 2021 17:40:25 -0800 Subject: [PATCH] macros: pass CFLAGS/CXXFLAGS to the processes started by cargo This is mainly targeted to the crates using `rust-cc`, where we want to apply system-wide compiler flags when invoking the compiler. `cc` supports CFLAGS and CXXFLAGS, but we never set those. Defining that per project is not possible, as we have no way to inherit any build context from a dependency package. Possibly also affects: `bindgen`, `cxx`, any other crate that invokes the C/C++ compiler and passes the CFLAGSS --- data/macros.cargo | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/macros.cargo b/data/macros.cargo index 0a68998..07fcb56 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -22,6 +22,11 @@ rustc = "%{__rustc}"\ rustdoc = "%{__rustdoc}"\ rustflags = %{__global_rustflags_toml}\ \ +[env]\ +CFLAGS = "%{build_cflags}"\ +CXXFLAGS = "%{build_cxxflags}"\ +LDFLAGS = "%{build_ldflags}"\ +\ [install]\ root = "%{buildroot}%{_prefix}"\ \