cmake: Check -Wno-* compiler options for leveldb target

Check for -Wfoo rather than -Wno-foo because the latter may not cause
the test to fail.
This commit is contained in:
Hennadii Stepanov 2024-11-25 15:10:17 +00:00
parent 2638fdb4f9
commit 9e4a4b4832
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -88,9 +88,11 @@ if(MSVC)
_CRT_NONSTDC_NO_WARNINGS
)
else()
target_compile_options(nowarn_leveldb_interface INTERFACE
-Wno-conditional-uninitialized
-Wno-suggest-override
try_append_cxx_flags("-Wconditional-uninitialized" TARGET nowarn_leveldb_interface SKIP_LINK
IF_CHECK_PASSED "-Wno-conditional-uninitialized"
)
try_append_cxx_flags("-Wsuggest-override" TARGET nowarn_leveldb_interface SKIP_LINK
IF_CHECK_PASSED "-Wno-suggest-override"
)
endif()