diff --git a/cmake/ResInsightCommonSettings.cmake b/cmake/ResInsightCommonSettings.cmake index cdd50309af..029beb659c 100644 --- a/cmake/ResInsightCommonSettings.cmake +++ b/cmake/ResInsightCommonSettings.cmake @@ -9,5 +9,13 @@ if(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS) target_compile_options(ResInsightCommonSettings INTERFACE /WX) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_compile_options(ResInsightCommonSettings INTERFACE -Werror) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # GCC's -Wfree-nonheap-object false-positives on inlined + # std::vector copies (GCC PR 104475) + target_compile_options( + ResInsightCommonSettings INTERFACE + -Wno-error=free-nonheap-object + ) + endif() endif() endif() \ No newline at end of file