diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 7c93a19717d..ed01d0d7bbb 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,6 @@ add_subdirectory(crc) -add_subdirectory_ifdef(CONFIG_JSON_LIBRARY json) +add_subdirectory_ifdef(CONFIG_JSON_LIBRARY json) +if(NOT CONFIG_NATIVE_APPLICATION) add_subdirectory(libc) +endif() add_subdirectory_if_kconfig(ring_buffer) diff --git a/lib/libc/Kconfig b/lib/libc/Kconfig index ddb6662b15b..df7253070a1 100644 --- a/lib/libc/Kconfig +++ b/lib/libc/Kconfig @@ -7,6 +7,7 @@ # menu "C Library" +depends on !NATIVE_APPLICATION config NEWLIB_LIBC bool diff --git a/misc/Kconfig b/misc/Kconfig index 51a8a4eef06..37cd3e47c5d 100644 --- a/misc/Kconfig +++ b/misc/Kconfig @@ -122,6 +122,13 @@ config CROSS_COMPILE need to set this unless you want the configured kernel build directory to select the cross-compiler automatically. +config NATIVE_APPLICATION + bool "Build as a native host application" + default n + help + Build as a native application that can run on the host and using + resources and libraries provided by the host. + config COMPILER_OPT string prompt "Custom compiler options"