2022-02-17 15:32:27 -08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
include(${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake)
|
|
|
|
|
2025-05-27 11:46:41 -07:00
|
|
|
# nostdinc needs to be cleared as it is needed for xtensa/config/core.h.
|
|
|
|
# nostdinc_include contains path to llvm headers.
|
2022-02-17 15:32:27 -08:00
|
|
|
set_compiler_property(PROPERTY nostdinc)
|
2025-05-27 11:46:41 -07:00
|
|
|
set_compiler_property(APPEND PROPERTY nostdinc_include ${NOSTDINC})
|
2023-01-30 20:19:18 -05:00
|
|
|
|
2022-02-17 15:32:27 -08:00
|
|
|
if($ENV{XCC_NO_G_FLAG})
|
|
|
|
# Older xcc/clang cannot use "-g" due to this bug:
|
|
|
|
# https://bugs.llvm.org/show_bug.cgi?id=11740.
|
|
|
|
# Clear the related flag(s) here so it won't cause issues.
|
|
|
|
set_compiler_property(PROPERTY debug)
|
|
|
|
endif()
|
2022-08-22 08:47:03 -07:00
|
|
|
|
|
|
|
# Clang version used by Xtensa does not support -fno-pic and -fno-pie
|
|
|
|
set_compiler_property(PROPERTY no_position_independent "")
|
2023-08-11 13:40:05 -07:00
|
|
|
|
|
|
|
# Remove after testing that -Wshadow works
|
|
|
|
set_compiler_property(PROPERTY warning_shadow_variables)
|
2025-01-17 11:47:14 -08:00
|
|
|
|
|
|
|
# xt-clang is usually based on older version of clang, and
|
|
|
|
# Zephyr main targets more recent versions. Because of this,
|
|
|
|
# some newer compiler flags may cause warnings where twister
|
|
|
|
# would mark as test being failed. To workaround that,
|
|
|
|
# add -Wno-unknown-warning-option to suppress those warnings.
|
|
|
|
check_set_compiler_property(APPEND PROPERTY warning_extended
|
|
|
|
-Wno-unknown-warning-option
|
|
|
|
)
|