b93651b976ff31286ec54764299d2bd10c6dd183
[fedora-reviews.git] / libblkio / 149.patch
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
5
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.
10
11 Make sure to handle optimization=plain so that cargo-build.sh doesn't
12 exit early.
13
14 Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
15 ---
16  src/cargo-build.sh | 5 +++++
17  1 file changed, 5 insertions(+)
18
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
24  esac
25  
26  case "${meson_optimization}" in
27 +    plain)
28 +        # A release build without explicit optimization flags
29 +        profile=release
30 +        args+=( --release )
31 +        ;;
32      0)
33          profile=debug
34          rustflags+=( -C opt-level=0 )
35 -- 
36 GitLab
37