abseil-cpp: Do not leak -Wnon-virtual-dtor into the .pc files

The -Wnon-virtual-dtor flag was unintentionally added to the .pc files,
which causes problems when abseil is used by C code:

  cc1: error: command-line option '-Wnon-virtual-dtor' is valid for
  C++/ObjC++ but not for C [-Werror]

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Peter Kjellerstedt 2024-10-01 08:31:17 +02:00 committed by Khem Raj
parent 5cff9e8672
commit 4ccccf20f7
No known key found for this signature in database
GPG Key ID: BB053355919D3314
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
From: Derek Mauro <dmauro@google.com>
Date: Mon, 5 Aug 2024 07:35:05 -0700
Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
suppress warnings in headers". It should fall through to the "don't impose
our warnings on others" case. Do this by matching on "-Wno-*" instead of
"-Wno*".
Fixes #1737
PiperOrigin-RevId: 659548798
Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
---
CMake/AbseilHelpers.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
index b177e590..3c4c92fe 100644
--- a/CMake/AbseilHelpers.cmake
+++ b/CMake/AbseilHelpers.cmake
@@ -195,7 +195,7 @@ function(absl_cc_library)
# specified platform. Filter both of them out before the successor
# reaches the "^-m" filter.
set(skip_next_cflag ON)
- elseif(${cflag} MATCHES "^(-Wno|/wd)")
+ elseif(${cflag} MATCHES "^(-Wno-|/wd)")
# These flags are needed to suppress warnings that might fire in our headers.
set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
elseif(${cflag} MATCHES "^(-W|/w[1234eo])")

View File

@ -14,6 +14,7 @@ SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
file://0002-Remove-maes-option-from-cross-compilation.patch \
file://0003-Remove-neon-option-from-cross-compilation.patch \
file://0004-abseil-ppc-fixes.patch \
file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
"
S = "${WORKDIR}/git"