]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
src/CMakeLists.txt: -Wno-vla-cxx-extension only on clang >= 18
authorMatan Breizman <mbreizma@redhat.com>
Tue, 18 Feb 2025 11:07:17 +0000 (11:07 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 24 Feb 2025 16:01:52 +0000 (16:01 +0000)
```
error: unknown warning option '-Wno-vla-cxx-extension'; did you mean '-Wno-vla-extension'? [-Werror,-Wunknown-warning-option]
```

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/CMakeLists.txt

index eea961a23f3c7e49159bbf900c211e28ee233bca..5586cd03a2f3b35f6c5c9c7745e4230a1d7778ac 100644 (file)
@@ -168,8 +168,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
     -Wno-gnu-designator
     -Wno-missing-braces
     -Wno-parentheses
-    -Wno-deprecated-register
+    -Wno-deprecated-register)
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
+    add_compile_options(
     -Wno-vla-cxx-extension)
+  endif()
   if(FREEBSD)
     # Need to use the GNU binutils linker to get versioning right.
     string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=/usr/local/bin/ld -Wno-unused-command-line-argument")