mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 16:22:41 +00:00
Moved compiler warnings around (#7471)
This commit is contained in:
@@ -358,26 +358,33 @@ if(MSVC_LIKE)
|
|||||||
>
|
>
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
set(IS_CLANG ON)
|
||||||
|
else()
|
||||||
|
set(IS_CLANG OFF)
|
||||||
|
endif()
|
||||||
target_compile_options(ProjectConfig
|
target_compile_options(ProjectConfig
|
||||||
INTERFACE
|
INTERFACE
|
||||||
-Wall
|
-Wall
|
||||||
-Wno-unknown-warning-option
|
|
||||||
$<$<BOOL:${FLATBUFFERS_STRICT_MODE}>:
|
$<$<BOOL:${FLATBUFFERS_STRICT_MODE}>:
|
||||||
-Werror # Treat all compiler warnings as errors
|
-Werror # Treat all compiler warnings as errors
|
||||||
|
|
||||||
# False positive string overflow
|
$<$<CXX_COMPILER_ID:GNU>:
|
||||||
# https://github.com/google/flatbuffers/issues/7366
|
# False positive string overflow
|
||||||
-Wno-error=stringop-overflow
|
# https://github.com/google/flatbuffers/issues/7366
|
||||||
|
-Wno-error=stringop-overflow
|
||||||
|
>
|
||||||
>
|
>
|
||||||
-pedantic
|
-pedantic
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
-Wold-style-cast
|
-Wold-style-cast
|
||||||
-Wimplicit-fallthrough
|
|
||||||
-fsigned-char
|
-fsigned-char
|
||||||
-Wnon-virtual-dtor
|
-Wnon-virtual-dtor
|
||||||
|
|
||||||
$<$<CXX_COMPILER_ID:CLANG>:
|
# This isn't working for some reason: $<$<CXX_COMPILER_ID:CLANG>:
|
||||||
|
$<$<BOOL:${IS_CLANG}>:
|
||||||
|
-Wno-unknown-warning-option
|
||||||
-Wmissing-declarations
|
-Wmissing-declarations
|
||||||
-Wzero-as-null-pointer-constant
|
-Wzero-as-null-pointer-constant
|
||||||
$<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,3.8>:
|
$<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,3.8>:
|
||||||
|
|||||||
Reference in New Issue
Block a user