mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-01 16:23:34 +00:00
Add an LLVM backend and a clang toolchain variant to support building with llvm coming with popular Linux distributions. This has been tested with X86 boards: - quark_d2000_crb - quark_se_c1000_devboard/Arduino 101 Use: export ZEPHYR_TOOLCHAIN_VARIANT=clang Signed-off-by: Anas Nashif <anas.nashif@intel.com>
23 lines
638 B
CMake
23 lines
638 B
CMake
# Configuration for host installed llvm
|
|
#
|
|
|
|
set(NOSTDINC "")
|
|
|
|
foreach(file_name include include-fixed)
|
|
execute_process(
|
|
COMMAND ${CMAKE_C_COMPILER} --print-file-name=${file_name}
|
|
OUTPUT_VARIABLE _OUTPUT
|
|
)
|
|
string(REGEX REPLACE "\n" "" _OUTPUT ${_OUTPUT})
|
|
|
|
list(APPEND NOSTDINC ${_OUTPUT})
|
|
endforeach()
|
|
|
|
foreach(isystem_include_dir ${NOSTDINC})
|
|
list(APPEND isystem_include_flags -isystem ${isystem_include_dir})
|
|
endforeach()
|
|
|
|
set(CMAKE_REQUIRED_FLAGS -nostartfiles -nostdlib ${isystem_include_flags} -Wl,--unresolved-symbols=ignore-in-object-files)
|
|
string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
|
|