From 51d66494fd277dd9acd138cbfb535c4875958efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Wed, 20 Apr 2022 13:12:43 +0300 Subject: [PATCH] mdbx-cmake: add `-Wno-lto-type-mismatch` to avoid false-positive warnings from GCC < 9.x --- cmake/compiler.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index ee487840..ddc113ce 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -609,6 +609,9 @@ macro(setup_compile_flags) AND CMAKE_${CMAKE_PRIMARY_LANG}_COMPILER_VERSION VERSION_LESS 9) # GCC < 9.x generates false-positive warnings for optimization attributes add_compile_flags("C;CXX" "-Wno-attributes") + if(LTO_ENABLED) + add_compile_flags("C;CXX" "-Wno-lto-type-mismatch") + endif() endif() # In C a global variable without a storage specifier (static/extern) and