libc: picolibc: extend support beyond Zephyr SDK

The picolibc kconfigs were tied to ZEPHYR_TOOLCHAIN_VARIANT
and it only supported the Zephyr SDK, which is the only
toolchain having picolibc built-in at the moment. This
commit generalizes that to use TOOLCHAIN_HAS_PICOLIBC
cmake variable the same way as newlib: TOOLCHAIN_HAS_NEWLIB.
This provides the ability for other toolchains to declare
their support for picolibc.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2023-07-25 09:27:58 -07:00 committed by Anas Nashif
parent 718a219bf1
commit 01dd2f0897
2 changed files with 3 additions and 3 deletions

View File

@ -35,8 +35,8 @@ config NEWLIB_LIBC_SUPPORTED
config PICOLIBC_SUPPORTED
bool
depends on !NATIVE_APPLICATION
depends on ("$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr") || (NATIVE_LIBRARY)
depends on !(CPP && "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr")
depends on ("$(TOOLCHAIN_HAS_PICOLIBC)" = "y") || (NATIVE_LIBRARY)
depends on !(CPP && ("$(TOOLCHAIN_HAS_PICOLIBC)" = "y"))
default y
select FULL_LIBC_SUPPORTED
help

View File

@ -5,7 +5,7 @@ if PICOLIBC
config PICOLIBC_USE_MODULE
bool "Picolibc as module"
default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "zephyr"
default y if "$(TOOLCHAIN_HAS_PICOLIBC)" != "y"
depends on ZEPHYR_PICOLIBC_MODULE
depends on !GLIBCXX_LIBCPP
help