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

cmake: use -Wshadow-compatible-local if supported

Summary:
Use the `use -Wshadow-compatible-local` flag if the compiler supports it.

This also required marking the gmock include directory as a system include
directory, to prevent the compiler from warning about existing name shadowing
in gmock's header files.

Reviewed By: yfeldblum

Differential Revision: D6787806

fbshipit-source-id: f0e5f6de543a47b19a09440c58ee2961dab23054
parent 51da0727
......@@ -29,6 +29,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
COMPILER_HAS_W_SHADOW_COMPATIBLE_LOCAL)
if (COMPILER_HAS_W_SHADOW_LOCAL AND COMPILER_HAS_W_SHADOW_COMPATIBLE_LOCAL)
set(FOLLY_HAVE_SHADOW_LOCAL_WARNINGS ON)
list(APPEND FOLLY_CXX_FLAGS -Wshadow-compatible-local)
endif()
CHECK_CXX_COMPILER_FLAG(-Wno-noexcept-type COMPILER_HAS_W_NOEXCEPT_TYPE)
......
......@@ -329,6 +329,7 @@ if (BUILD_TESTS)
${LIBGMOCK_DEFINES}
)
target_include_directories(folly_test_support
SYSTEM
PUBLIC
${LIBGMOCK_INCLUDE_DIR}
)
......
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