[cmake] add pedantic-errors flag (#4808)

This commit is contained in:
Jonathan Hui
2020-04-03 23:48:17 -07:00
parent f9470ed187
commit 9e3e8e0980
6 changed files with 19 additions and 5 deletions

View File

@ -51,7 +51,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
set(OT_CFLAGS
$<$<COMPILE_LANGUAGE:C>:${OT_CFLAGS} -Wall -Wextra -Wshadow -pedantic-errors>
$<$<COMPILE_LANGUAGE:CXX>:${OT_CFLAGS} -Wall -Wextra -Wshadow -Wno-c++14-compat -fno-exceptions>
$<$<COMPILE_LANGUAGE:CXX>:${OT_CFLAGS} -Wall -Wextra -Wshadow -Wno-c++14-compat -fno-exceptions -pedantic-errors>
)
endif()

View File

@ -33,7 +33,7 @@ set_target_properties(
openthread-cli-ftd openthread-cli-mtd
PROPERTIES
C_STANDARD 99
CXX_STANDARD 98
CXX_STANDARD 11
)
target_compile_definitions(openthread-cli-ftd PRIVATE

View File

@ -34,7 +34,7 @@ set_target_properties(
openthread-ftd openthread-mtd openthread-radio
PROPERTIES
C_STANDARD 99
CXX_STANDARD 98
CXX_STANDARD 11
)
target_compile_definitions(openthread-ftd PRIVATE

View File

@ -30,6 +30,13 @@ add_library(openthread-hdlc
hdlc.cpp
)
set_target_properties(
openthread-hdlc
PROPERTIES
C_STANDARD 99
CXX_STANDARD 11
)
target_include_directories(openthread-hdlc
PUBLIC
${OT_PUBLIC_INCLUDES}

View File

@ -29,6 +29,13 @@
add_library(openthread-spinel-ncp)
add_library(openthread-spinel-rcp)
set_target_properties(
openthread-spinel-ncp openthread-spinel-rcp
PROPERTIES
C_STANDARD 99
CXX_STANDARD 11
)
target_compile_definitions(openthread-spinel-ncp PRIVATE
${OT_PRIVATE_DEFINES}
OPENTHREAD_FTD=1

View File

@ -32,10 +32,10 @@ add_library(openthread-rcp)
# We depend on C++11 to validate that NCP handlers are sorted.
set_target_properties(
openthread-ncp-mtd openthread-rcp
openthread-ncp-ftd openthread-ncp-mtd openthread-rcp
PROPERTIES
C_STANDARD 99
CXX_STANDARD 98
CXX_STANDARD 11
)
target_compile_definitions(openthread-ncp-ftd PRIVATE