diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -456,9 +456,18 @@ option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF) option(LLVM_STATIC_LINK_CXX_STDLIB "Statically link the standard library." OFF) option(LLVM_ENABLE_LLD "Use lld as C and C++ linker." OFF) -option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # -pedantic may warn on extensions from newer standards that are widely ported + # to older language modes. They are usually of lower value and cannot be + # suppressed by pragma ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90843), + # so we just disable -pedantic by default. + option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled" OFF) +else() + option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled" ON) +endif() + option(LLVM_ENABLE_DUMP "Enable dump functions even when assertions are disabled" OFF) if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )