You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-packaging/168.patch

35 lines
1.0 KiB

From f1be3a0d4d2df6497d46f627cc54ce8450da8699 Mon Sep 17 00:00:00 2001
From: Aleksei Bavshin <alebastr@fedoraproject.org>
Date: Dec 06 2021 06:20:52 +0000
Subject: 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
---
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}"\
\