From 44dccb5b15c146358f8544d492f678a469ef721d Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Wed, 7 Jun 2023 16:40:57 -0700 Subject: Don't use -fstdarg-opt with clang-tidy (#3079) * HDFCompilerFlags: mask -fstdarg-opt with clang-tidy `clang-tidy` doesn't understand this `-f` flag and errors out. * Add helpful comment --------- Co-authored-by: Sean McBride --- config/cmake/HDFCompilerFlags.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 1bbf57c..00850d3 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -54,7 +54,9 @@ if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") endif () else () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND + NOT CMAKE_C_CLANG_TIDY) + # `clang-tidy` does not understand -fstdarg-opt set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) -- cgit v0.12