The clang -Wno-error=#warnings flag, used to not break the build when
a #warning directive is encountered, is unfortunate in containing
a comment introducing character ("#"). In our case, pkg-config
interprets it as a comment and truncates the line containing it at
that position.
Unfortunately, we cannot bring to bear cmake's text processing functions
(for example, string (REPLACE ...)) since compile options are not
available during configure time (see [1]). We can process compile options
using generator-expressions (see [2]), but these facilities do not
include a general search-and-replace.
To allow forward process, simply filter out the annoying option.
This is doable using generator-expressions. The pkgconfig output
is now usable, but users will have to detect the availability of
-Wno-error=#warnings and add it themselves and cannot rely on Seastar
to provide it. This only matters on platforms where Seastar issues
such warnings (anything that isn't x86_64, aarch64, s390x).
[1]
https://stackoverflow.com/questions/51353110/how-do-i-output-the-result-of-a-generator-expression-in-cmake
[2]
https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#string-transformations
---
pkgconfig/
seastar.pc.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkgconfig/
seastar.pc.in b/pkgconfig/
seastar.pc.in
index 1623e101a3..edd938f71c 100644
--- a/pkgconfig/
seastar.pc.in
+++ b/pkgconfig/
seastar.pc.in
@@ -30,11 +30,11 @@ lksctp_tools_cflags=-I$<JOIN:@lksctp-tools_INCLUDE_DIRS@, -I>
lksctp_tools_libs=$<JOIN:@lksctp-tools_LIBRARIES@, >
numactl_cflags=-I$<JOIN:@numactl_INCLUDE_DIRS@, -I>
numactl_libs=$<JOIN:@numactl_LIBRARIES@, >
# Us.
-seastar_cflags=${seastar_include_flags} $<JOIN:$<TARGET_PROPERTY:seastar,INTERFACE_COMPILE_OPTIONS>, > -D$<JOIN:$<TARGET_PROPERTY:seastar,INTERFACE_COMPILE_DEFINITIONS>, -D>
+seastar_cflags=${seastar_include_flags} $<JOIN:$<FILTER:$<TARGET_PROPERTY:seastar,INTERFACE_COMPILE_OPTIONS>,EXCLUDE,-Wno-error=#warnings>, > -D$<JOIN:$<TARGET_PROPERTY:seastar,INTERFACE_COMPILE_DEFINITIONS>, -D>
seastar_libs=${libdir}/$<TARGET_FILE_NAME:seastar> @Seastar_SPLIT_DWARF_FLAG@ $<JOIN:@Seastar_Sanitizers_OPTIONS@, >
Requires: liblz4 >= 1.7.3
Requires.private: gnutls >= 3.2.26, protobuf >= 2.5.0, hwloc >= 1.11.2, yaml-cpp >= 0.5.1
Conflicts:
--
2.30.2