diff --git a/cmake/compiler_utils.cmake b/cmake/compiler_utils.cmake index 7ebfba6..7aac16d 100644 --- a/cmake/compiler_utils.cmake +++ b/cmake/compiler_utils.cmake @@ -31,11 +31,6 @@ function(compiler_get_warnings_setup VARNAME) "-Wno-documentation-html" "-Wno-documentation" ) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "18.0.0") - set(WARNINGS_SETUP_LIST "${WARNINGS_SETUP_LIST}" - "-Wno-unsafe-buffer-usage" - ) - endif () string(REPLACE ";" " " WARNINGS_SETUP "${WARNINGS_SETUP_LIST}") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") set(WARNINGS_SETUP "/W3 /wd4800") @@ -109,6 +104,10 @@ function(compiler_get_warnings_as_errors_setup VARNAME) ) string(REPLACE ";" " " WARNINGS_SETUP "${WARNINGS_SETUP} ${WARNINGS_SETUP_LIST}") endif () + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "18.0.0") + set(WARNINGS_SETUP # need to refactor all pointer arithmetic to span/vector/array+index usage + "${WARNINGS_SETUP} -Wno-error=unsafe-buffer-usage") + endif () elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") if (ZSERIO_ENABLE_WERROR) set(WARNINGS_SETUP "/WX")