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 <sean@rogue-research.com>
This commit is contained in:
Dana Robinson 2023-06-07 16:40:57 -07:00 committed by GitHub
parent 76bc845a2f
commit 44dccb5b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)