Skip to content

Commit f2c4779

Browse files
ozhurakinashif
authored andcommitted
cmake: clang: Provide toolchain_cc_nostdinc() macro
native_posix should build with standard includes. Signed-off-by: Oleg Zhurakivskyy <[email protected]>
1 parent a399924 commit f2c4779

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/compiler/clang/target.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ set(CMAKE_REQUIRED_FLAGS -nostartfiles -nostdlib ${isystem_include_flags} -Wl,--
6262
string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
6363

6464
# Load toolchain_cc-family macros
65+
66+
macro(toolchain_cc_nostdinc)
67+
if(NOT "${ARCH}" STREQUAL "posix")
68+
zephyr_compile_options( -nostdinc)
69+
endif()
70+
endmacro()
71+
6572
# Clang and GCC are almost feature+flag compatible, so reuse freestanding gcc
6673
include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_security_canaries.cmake)
6774
include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_optimizations.cmake)

0 commit comments

Comments
 (0)