]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/cmake: restrict -Wno-non-virtual-dtor to C++ sources 69520/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Mon, 15 Jun 2026 20:10:15 +0000 (04:10 +0800)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Tue, 16 Jun 2026 11:25:22 +0000 (19:25 +0800)
The seastar target exports -Wno-non-virtual-dtor as a PUBLIC compile
option, so it leaks to every target that links seastar, including C
sources such as crimson-common's reverse.c, producing:

  cc1: warning: command-line option '-Wno-non-virtual-dtor' is valid for C++/ObjC++ but not for C

Guard the option with $<COMPILE_LANGUAGE:CXX> so that it only applies to
C++ compilations.

Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
src/CMakeLists.txt

index a93a38d7501f14e1a5ee3a0d85c97b53e94fe48c..b5fd500e8eae7ca053279663ab0385860272737e 100644 (file)
@@ -502,7 +502,7 @@ if(WITH_CRIMSON)
   target_compile_options(seastar
   PUBLIC
     # required by any target that links to seastar
-    "-Wno-non-virtual-dtor"
+    "$<$<COMPILE_LANGUAGE:CXX>:-Wno-non-virtual-dtor>"
   PRIVATE
     "-DSEASTAR_NO_EXCEPTION_HACK"
     "-Wno-error"