Skip to content

Commit 9e4a4b4

Browse files
committed
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.
1 parent 2638fdb commit 9e4a4b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmake/leveldb.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ if(MSVC)
8888
_CRT_NONSTDC_NO_WARNINGS
8989
)
9090
else()
91-
target_compile_options(nowarn_leveldb_interface INTERFACE
92-
-Wno-conditional-uninitialized
93-
-Wno-suggest-override
91+
try_append_cxx_flags("-Wconditional-uninitialized" TARGET nowarn_leveldb_interface SKIP_LINK
92+
IF_CHECK_PASSED "-Wno-conditional-uninitialized"
93+
)
94+
try_append_cxx_flags("-Wsuggest-override" TARGET nowarn_leveldb_interface SKIP_LINK
95+
IF_CHECK_PASSED "-Wno-suggest-override"
9496
)
9597
endif()
9698

0 commit comments

Comments
 (0)