diff --git a/cmake/CMakeCompiler.cmake b/cmake/CMakeCompiler.cmake index d1131500..e907c6d3 100644 --- a/cmake/CMakeCompiler.cmake +++ b/cmake/CMakeCompiler.cmake @@ -89,7 +89,13 @@ macro(setup_default_compiler_flags _project_name) target_compile_options(${_project_name} PRIVATE -Werror) # Treat warnings as errors # Disable various warnings that are harmless - target_compile_options(${_project_name} PRIVATE -Wno-c++98-compat) # No need to support C++98 + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(${_project_name} PRIVATE -Wno-c++98-compat) # No need to support C++98 + elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9) + target_compile_options(${_project_name} PRIVATE -Wno-attributes) # False positive with earlier versions of GCC + endif() + endif() if (PLATFORM_EMSCRIPTEN) # Remove '-g' from compilation flags since it sometimes crashes the compiler