Skip to content

Commit ba9eb35

Browse files
authored
attempt to fix compile warning (iresearch-toolkit#569)
the compile option `-fsized-deallocation` should only be used for C++ code, but not for C code. otherwise clang warns with the following message: ``` warning: command-line option ‘-fsized-deallocation’ is valid for C++/ObjC++ but not for C ```
1 parent f69a39d commit ba9eb35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ if (MSVC)
145145
set(CMAKE_CXX_FLAGS "/Zc:static_assert- ${CMAKE_CXX_FLAGS}")
146146
endif ()
147147
else ()
148-
# We want to force clang to use it
149-
add_compile_options(-fsized-deallocation)
148+
# We want to force clang/gcc to use it, but only for C++ files
149+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>)
150150
endif ()
151151

152152
# fix strange issue with utf_8_to_32_iterator failing

0 commit comments

Comments
 (0)