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

only use -Wno-inconsistent-missing-override if supported

Summary:
Check if the compiler supports -Winconsistent-missing-override before trying to
disable this warning.

It looks like gcc wouldn't actually fail the build if
`-Wno-inconsistent-missing-override` was specified but was not supported.
However, if the build failed due to other compile errors the error messages
about this flag would make it confusing to identify the actual build failure
reason.

Closes issue #836.

Reviewed By: yfeldblum

Differential Revision: D7920577

fbshipit-source-id: 322444a9df3f4f36bb5420f0720c1e433c2856b7
parent bf237b57
...@@ -23,7 +23,6 @@ function(apply_folly_compile_options_to_target THETARGET) ...@@ -23,7 +23,6 @@ function(apply_folly_compile_options_to_target THETARGET)
-Wno-error=deprecated-declarations -Wno-error=deprecated-declarations
-Wno-sign-compare -Wno-sign-compare
-Wno-unused -Wno-unused
-Wno-inconsistent-missing-override
-Wunused-label -Wunused-label
-Wunused-result -Wunused-result
-Wnon-virtual-dtor -Wnon-virtual-dtor
......
...@@ -43,6 +43,13 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") ...@@ -43,6 +43,13 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(APPEND FOLLY_CXX_FLAGS -Wno-nullability-completeness) list(APPEND FOLLY_CXX_FLAGS -Wno-nullability-completeness)
endif() endif()
CHECK_CXX_COMPILER_FLAG(
-Winconsistent-missing-override
COMPILER_HAS_W_INCONSISTENT_MISSING_OVERRIDE)
if (COMPILER_HAS_W_INCONSISTENT_MISSING_OVERRIDE)
list(APPEND FOLLY_CXX_FLAGS -Wno-inconsistent-missing-override)
endif()
CHECK_CXX_COMPILER_FLAG(-faligned-new COMPILER_HAS_F_ALIGNED_NEW) CHECK_CXX_COMPILER_FLAG(-faligned-new COMPILER_HAS_F_ALIGNED_NEW)
if (COMPILER_HAS_F_ALIGNED_NEW) if (COMPILER_HAS_F_ALIGNED_NEW)
list(APPEND FOLLY_CXX_FLAGS -faligned-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