From f2c4779b8492496a2a6d14c3ef37bd52d5452ea2 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakivskyy Date: Fri, 8 Mar 2019 13:46:27 +0200 Subject: [PATCH] cmake: clang: Provide toolchain_cc_nostdinc() macro native_posix should build with standard includes. Signed-off-by: Oleg Zhurakivskyy --- cmake/compiler/clang/target.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/compiler/clang/target.cmake b/cmake/compiler/clang/target.cmake index 660b36c4969..f034fa0394b 100644 --- a/cmake/compiler/clang/target.cmake +++ b/cmake/compiler/clang/target.cmake @@ -62,6 +62,13 @@ set(CMAKE_REQUIRED_FLAGS -nostartfiles -nostdlib ${isystem_include_flags} -Wl,-- string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") # Load toolchain_cc-family macros + +macro(toolchain_cc_nostdinc) + if(NOT "${ARCH}" STREQUAL "posix") + zephyr_compile_options( -nostdinc) + endif() +endmacro() + # Clang and GCC are almost feature+flag compatible, so reuse freestanding gcc include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_security_canaries.cmake) include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_optimizations.cmake)