diff --git a/cmake/compiler/gcc/compiler_flags.cmake b/cmake/compiler/gcc/compiler_flags.cmake index 7c3284eb47d..0d4d6942360 100644 --- a/cmake/compiler/gcc/compiler_flags.cmake +++ b/cmake/compiler/gcc/compiler_flags.cmake @@ -106,7 +106,7 @@ set_compiler_property(PROPERTY cstd -std=) if (NOT CONFIG_NEWLIB_LIBC AND NOT COMPILER STREQUAL "xcc" AND - NOT ZEPHYR_TOOLCHAIN_VARIANT STREQUAL "espressif" AND + NOT CONFIG_HAS_ESPRESSIF_HAL AND NOT CONFIG_NATIVE_APPLICATION) set_compiler_property(PROPERTY nostdinc -nostdinc) set_compiler_property(APPEND PROPERTY nostdinc_include ${NOSTDINC}) diff --git a/modules/Kconfig b/modules/Kconfig index c582e0ea855..6a45dcbe1c2 100644 --- a/modules/Kconfig +++ b/modules/Kconfig @@ -13,6 +13,7 @@ source "modules/Kconfig.civetweb" source "modules/Kconfig.cmsis" source "modules/Kconfig.cypress" source "modules/Kconfig.eos_s3" +source "modules/Kconfig.esp32" source "modules/Kconfig.imx" source "modules/Kconfig.infineon" source "modules/Kconfig.libmetal" diff --git a/modules/Kconfig.esp32 b/modules/Kconfig.esp32 new file mode 100644 index 00000000000..11541e83d6f --- /dev/null +++ b/modules/Kconfig.esp32 @@ -0,0 +1,6 @@ +# Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config HAS_ESPRESSIF_HAL + bool + depends on SOC_ESP32 || SOC_ESP32S2 || SOC_ESP32C3 diff --git a/soc/riscv/esp32c3/Kconfig.soc b/soc/riscv/esp32c3/Kconfig.soc index 331a6149496..35c84a7de85 100644 --- a/soc/riscv/esp32c3/Kconfig.soc +++ b/soc/riscv/esp32c3/Kconfig.soc @@ -10,6 +10,7 @@ config SOC_ESP32C3 select CLOCK_CONTROL_ESP32 select PINCTRL select XIP + select HAS_ESPRESSIF_HAL if SOC_ESP32C3 diff --git a/soc/xtensa/esp32/Kconfig.soc b/soc/xtensa/esp32/Kconfig.soc index 870173b01b7..a475dffb26e 100644 --- a/soc/xtensa/esp32/Kconfig.soc +++ b/soc/xtensa/esp32/Kconfig.soc @@ -11,6 +11,7 @@ config SOC_ESP32 select ARCH_SUPPORTS_COREDUMP select PINCTRL select XIP + select HAS_ESPRESSIF_HAL if SOC_ESP32 diff --git a/soc/xtensa/esp32s2/Kconfig.soc b/soc/xtensa/esp32s2/Kconfig.soc index 8676c681cab..57c538cfcb7 100644 --- a/soc/xtensa/esp32s2/Kconfig.soc +++ b/soc/xtensa/esp32s2/Kconfig.soc @@ -10,6 +10,7 @@ config SOC_ESP32S2 select CLOCK_CONTROL_ESP32 select PINCTRL select XIP + select HAS_ESPRESSIF_HAL if SOC_ESP32S2