Commit 2adc542f authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

cmake: fix checks for compiler warning flags

Summary:
gcc does not complain about unknown `-Wno-*` flags by default, and older
versions of gcc do not support `-Werror=unknown-warning-option`.  Therefore
these checks for `-Wno-noexcept-type` and `-Wno-nullability-completeness` could
incorrectly indicate that the compiler supports these flags.

This changes the checks to check against the positive version of the warning
flag.

Reviewed By: yfeldblum

Differential Revision: D7035995

fbshipit-source-id: b1511d31721aeb779859848e20820c8a7fea4faa
parent f58a4bd5
......@@ -32,13 +32,13 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(APPEND FOLLY_CXX_FLAGS -Wshadow-compatible-local)
endif()
CHECK_CXX_COMPILER_FLAG(-Wno-noexcept-type COMPILER_HAS_W_NOEXCEPT_TYPE)
CHECK_CXX_COMPILER_FLAG(-Wnoexcept-type COMPILER_HAS_W_NOEXCEPT_TYPE)
if (COMPILER_HAS_W_NOEXCEPT_TYPE)
list(APPEND FOLLY_CXX_FLAGS -Wno-noexcept-type)
endif()
CHECK_CXX_COMPILER_FLAG(
-Wno-nullability-completeness
-Wnullability-completeness
COMPILER_HAS_W_NULLABILITY_COMPLETENESS)
if (COMPILER_HAS_W_NULLABILITY_COMPLETENESS)
list(APPEND FOLLY_CXX_FLAGS -Wno-nullability-completeness)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment