1 From c2195221fcec63ee8b6350379fab03b82210e9e3 Mon Sep 17 00:00:00 2001
2 From: Stefan Hajnoczi <stefanha@redhat.com>
3 Date: Tue, 22 Nov 2022 14:03:17 -0500
4 Subject: [PATCH] cargo-build.sh: support optimization=plain
6 meson 0.64.0 added optimization=plain. It means that no optimization
7 flags are explicitly passed to the compiler. This is useful in
8 situations where the environment wants to control compiler flags (e.g.
9 nix, rpm, etc), typically via CFLAGS, CXXFLAGS, etc.
11 Make sure to handle optimization=plain so that cargo-build.sh doesn't
14 Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
16 src/cargo-build.sh | 5 +++++
17 1 file changed, 5 insertions(+)
19 diff --git a/src/cargo-build.sh b/src/cargo-build.sh
20 index 2ad5463..9879d44 100755
21 --- a/src/cargo-build.sh
22 +++ b/src/cargo-build.sh
23 @@ -16,6 +16,11 @@ case "${meson_debug}" in
26 case "${meson_optimization}" in
28 + # A release build without explicit optimization flags
34 rustflags+=( -C opt-level=0 )