mirror of
https://github.com/espressif/openthread.git
synced 2025-08-06 14:52:18 +08:00
[cmake] disable -pedantic-errors together with -Werror (#4775)
This allows to work-around a compile error that is happening in Zephyr <https://github.com/zephyrproject-rtos/openthread/pull/9>. Signed-off-by: Markus Becker <markus.becker@tridonic.com>
This commit is contained in:
@ -38,9 +38,9 @@ include("${PROJECT_SOURCE_DIR}/etc/cmake/options.cmake")
|
||||
include("${PROJECT_SOURCE_DIR}/etc/cmake/functions.cmake")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
|
||||
option(OT_COMPILE_WARNING_AS_ERROR "whether to include -Werror with gcc-compatible compilers")
|
||||
option(OT_COMPILE_WARNING_AS_ERROR "whether to include -Werror -pedantic-errors with gcc-compatible compilers")
|
||||
if (OT_COMPILE_WARNING_AS_ERROR)
|
||||
set(OT_CFLAGS -Werror)
|
||||
set(OT_CFLAGS -Werror -pedantic-errors)
|
||||
endif()
|
||||
|
||||
if(OT_COVERAGE)
|
||||
@ -50,8 +50,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
|
||||
endif()
|
||||
|
||||
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 -pedantic-errors>
|
||||
$<$<COMPILE_LANGUAGE:C>:${OT_CFLAGS} -Wall -Wextra -Wshadow>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${OT_CFLAGS} -Wall -Wextra -Wshadow -Wno-c++14-compat -fno-exceptions>
|
||||
)
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user