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

cmake: compile with -Wno-nullability-completeness

Summary:
When compiling with clang, also specify -Wno-nullability-completeness

We currently use this flag for internal Facebook builds using buck.  This
brings the CMake and buck compilation command lines closer in sync.  Even
though the folly code currently does not produce any nullability completeness
warnings, we are likely to break this in the future since we do not have
this warning enabled internally.

It also seems like `-Wnullability-completeness` results in code that cannot be
compiled successfully across various clang versions.  Recent versions of clang
complain about missing nullability specifiers on `std::unique_ptr` arguments,
while slightly older clang versions produce compilation errors if nullability
specifiers are listed on anything but raw pointers.

Reviewed By: igorsugak

Differential Revision: D6902930

fbshipit-source-id: 0b8cd5eca17cf8f9deda6b0c32f5838489542128
parent 7c644897
......@@ -37,6 +37,13 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(APPEND FOLLY_CXX_FLAGS -Wno-noexcept-type)
endif()
CHECK_CXX_COMPILER_FLAG(
-Wno-nullability-completeness
COMPILER_HAS_W_NULLABILITY_COMPLETENESS)
if (COMPILER_HAS_W_NULLABILITY_COMPLETENESS)
list(APPEND FOLLY_CXX_FLAGS -Wno-nullability-completeness)
endif()
CHECK_CXX_COMPILER_FLAG(-faligned-new COMPILER_HAS_F_ALIGNED_NEW)
if (COMPILER_HAS_F_ALIGNED_NEW)
list(APPEND FOLLY_CXX_FLAGS -faligned-new)
......
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