Skip to content

Commit

Permalink
Don't warn about ##__VA_ARGS__ when using clang
Browse files Browse the repository at this point in the history
  • Loading branch information
vlstill committed Feb 15, 2023
1 parent 7783291 commit da5b506
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ add_cxx_compiler_option ("-Wno-deprecated-declarations")
# or in future versions of GCC.
add_cxx_compiler_option ("-pedantic")

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# The ##__VA_ARGS__ GNU extension is needed for IR. But clang compains about it.
# FIXME: with C++20 we would be able to use standard __VA_OPT__
add_cxx_compiler_option ("-Wno-gnu-zero-variadic-macro-arguments")
endif()

if (ENABLE_SANITIZERS)
append("-fsanitize=undefined,address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif ()
Expand Down

0 comments on commit da5b506

Please sign in to comment.