bit7z: Fix build with clang

The 4.1.0 upgrade added two CXXFLAGS that only work with GCC, which
breaks the clang build of the testsuite (BIT7Z_WARNINGS_AS_ERRORS
defaults to BIT7Z_BUILD_TESTS, so -Werror is on whenever ptest is
enabled).

  error: unknown warning option '-Wno-sfinae-incomplete'; did you mean
    '-Wno-delete-incomplete'? [-Werror,-Wunknown-warning-option]

-Wsfinae-incomplete is a GCC 15+ diagnostic that clang does not have, so
only pass it when building with GCC.

  cpm_cache/ghc_filesystem/include/ghc/filesystem.hpp:4090:41: error:
    implicit conversion changes signedness: 'int' to 'mode_t'
    (aka 'unsigned int') [-Werror,-Wsign-conversion]

Upstream declares the ghc::filesystem include directory as a SYSTEM one
(target_include_directories(ghc_filesystem SYSTEM INTERFACE ...) in
cmake/Dependencies.cmake), which keeps warnings from that header quiet.
Passing it as a plain -I undoes that, so use -isystem instead.

There is nothing to upgrade to here, 4.1.0 is the latest release and
upstream master is a single documentation commit ahead of it.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj
2026-09-11 22:47:21 -07:00
parent cd5b66b5d9
commit e43f9ef8c9
+9 -2
View File
@@ -35,8 +35,15 @@ DEPENDS = "7zip"
EXTRA_OECMAKE += "-DBIT7Z_CUSTOM_7ZIP_PATH=${STAGING_INCDIR}/7zip"
CXXFLAGS:append = " -Wno-error=array-bounds -Wno-sfinae-incomplete"
CXXFLAGS:append = " -I${B}/cpm_cache/ghc_filesystem/include"
CXXFLAGS:append = " -Wno-error=array-bounds"
# -Wsfinae-incomplete is a GCC 15+ diagnostic, clang does not know the option
# and errors out on it because the testsuite build enables -Werror.
CXXFLAGS:append:toolchain-gcc = " -Wno-sfinae-incomplete"
# Use -isystem, the same way upstream declares this include directory
# (target_include_directories(ghc_filesystem SYSTEM INTERFACE ...) in
# cmake/Dependencies.cmake). With a plain -I the warnings coming out of
# ghc/filesystem.hpp are reported and the testsuite build enables -Werror.
CXXFLAGS:append = " -isystem ${B}/cpm_cache/ghc_filesystem/include"
PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
PACKAGECONFIG[tests] = " \