From f3b4e020e127a212e3037c8c745cc42ae5362984 Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Fri, 10 Nov 2023 21:41:23 +0100 Subject: [PATCH] Try get rid of warnings --- utest/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/utest/CMakeLists.txt b/utest/CMakeLists.txt index 3b62fb10..01e2eff0 100644 --- a/utest/CMakeLists.txt +++ b/utest/CMakeLists.txt @@ -2,6 +2,9 @@ # Test project name. project(boxes_utest LANGUAGES C) +include(CheckCCompilerFlag) +check_c_compiler_flag(-Wno-stringop-overflow HAVE_STRINGOP_OVERFLOW) + # ============================================================================= # Find required packages. If used from Conan, make sure to run "conan install" before. @@ -23,6 +26,12 @@ set(SOURCES main.c ) +if (HAVE_STRINGOP_OVERFLOW) + target_compile_options(${TARGET} + PRIVATE -Wno-stringop-overflow + ) +endif (HAVE_STRINGOP_OVERFLOW) + # ----------------------------------------------------------------------------- add_executable(${TARGET}