Do not treat GCC free-nonheap-object warning as error

GCC's -Wfree-nonheap-object false-positives on inlined std::vector copies
(GCC PR 104475), breaking -Werror builds with GCC 15 on Ubuntu 26.04. Keep
the warning visible but do not let it fail the build.
This commit is contained in:
Kristian Bendiksen
2026-09-01 07:44:52 +02:00
committed by Magne Sjaastad
parent 88119f9c37
commit 7e1c38bf99
+8
View File
@@ -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()