Index: lib/scudo/standalone/CMakeLists.txt =================================================================== --- lib/scudo/standalone/CMakeLists.txt +++ lib/scudo/standalone/CMakeLists.txt @@ -6,9 +6,14 @@ list(APPEND SCUDO_CFLAGS -Wall - -Werror -nostdinc++) +# Do not error out on spurious flags. They can be passed via CMAKE_CXX_FLAGS +# for example, so we have very little control on those. +if(COMPILER_RT_ENABLE_WERROR) + append_string_if(COMPILER_RT_HAS_WERROR_FLAG -Wno-unused-command-line-argument SCUDO_CFLAGS) +endif() + append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding SCUDO_CFLAGS) append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SCUDO_CFLAGS)