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
This commit is contained in:
Aleksei Bavshin 2021-12-05 17:40:25 -08:00
parent aa6282874f
commit f1be3a0d4d
No known key found for this signature in database
GPG key ID: 4F071603387A382A

View file

@ -22,6 +22,11 @@ rustc = "%{__rustc}"\
rustdoc = "%{__rustdoc}"\ rustdoc = "%{__rustdoc}"\
rustflags = %{__global_rustflags_toml}\ rustflags = %{__global_rustflags_toml}\
\ \
[env]\
CFLAGS = "%{build_cflags}"\
CXXFLAGS = "%{build_cxxflags}"\
LDFLAGS = "%{build_ldflags}"\
\
[install]\ [install]\
root = "%{buildroot}%{_prefix}"\ root = "%{buildroot}%{_prefix}"\
\ \