From 33dee19bced42c817a3388eb4f9624a336fcf4bc Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 26 Jan 2024 15:50:07 +0000 Subject: [PATCH] fixup! cmake: Build `leveldb` static library This change introduces a new `warn_leveldb_interface`, which overrides `-Wconditional-uninitialized` and `-Wsuggest-override` if any. For MSVC builds, dropped warning suppressions that are provided at the global level. --- cmake/leveldb.cmake | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/cmake/leveldb.cmake b/cmake/leveldb.cmake index 8614365edad23..4193b172bd11e 100644 --- a/cmake/leveldb.cmake +++ b/cmake/leveldb.cmake @@ -74,21 +74,23 @@ target_include_directories(leveldb $ ) +add_library(nowarn_leveldb_interface INTERFACE) if(MSVC) - target_compile_options(leveldb - PRIVATE - /wd4244 - /wd4267 - $<$:/wd4722> + target_compile_options(nowarn_leveldb_interface INTERFACE + /wd4722 ) - target_compile_definitions(leveldb - PRIVATE - _CRT_NONSTDC_NO_DEPRECATE - _CRT_SECURE_NO_WARNINGS + target_compile_definitions(nowarn_leveldb_interface INTERFACE + _CRT_NONSTDC_NO_WARNINGS + ) +else() + target_compile_options(nowarn_leveldb_interface INTERFACE + -Wno-conditional-uninitialized + -Wno-suggest-override ) endif() -#TODO: figure out how to filter out: -# -Wconditional-uninitialized -Werror=conditional-uninitialized -Wsuggest-override -Werror=suggest-override - -target_link_libraries(leveldb PRIVATE core_interface crc32c) +target_link_libraries(leveldb PRIVATE + core_interface + nowarn_leveldb_interface + crc32c +)