]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: only apply C++ compile options to C++ language
authorKefu Chai <kchai@redhat.com>
Sat, 20 Jun 2020 04:01:55 +0000 (12:01 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 20 Jun 2020 04:02:13 +0000 (12:02 +0800)
we have sources written in C language, and they are compiled along with
C++ source files which uses Seastar library. so when the C compiler sees
the options exposed by seastar, it complains like

1: warning: command line option '-fconcepts' is valid for C++/ObjC++ but
not for C

with this change, only C++ options is added for C++ language.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/CMakeLists.txt

index e30aef360fecfb16c2798f688a19a8ad8f959269..6eb60b0c255a7921bc7992c1f2af255ebffd711b 100644 (file)
@@ -8,7 +8,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GR
 endif()
 set_target_properties(crimson::cflags PROPERTIES
   INTERFACE_COMPILE_DEFINITIONS "${crimson_cflag_definitions}"
-  INTERFACE_COMPILE_OPTIONS "-Wno-non-virtual-dtor"
+  INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CXX>:-Wno-non-virtual-dtor>
   INTERFACE_LINK_LIBRARIES Seastar::seastar)
 
 set(crimson_common_srcs