From ba9eb351b0bfd7a1a4c048404ed2565b71298ffb Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 31 Oct 2023 12:06:04 +0100 Subject: [PATCH] attempt to fix compile warning (#569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ``` --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19d2461df..1acbdc637 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,8 +145,8 @@ if (MSVC) set(CMAKE_CXX_FLAGS "/Zc:static_assert- ${CMAKE_CXX_FLAGS}") endif () else () - # We want to force clang to use it - add_compile_options(-fsized-deallocation) + # We want to force clang/gcc to use it, but only for C++ files + add_compile_options($<$:-fsized-deallocation>) endif () # fix strange issue with utf_8_to_32_iterator failing