diff --git a/CMakeLists.txt b/CMakeLists.txt index 0eaa3feb3e..4081ba0456 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,9 +60,6 @@ zephyr_library_named(zephyr) zephyr_include_directories( kernel/include arch/${ARCH}/include - ${SOC_DIR}/${ARCH}/${SOC_PATH} - ${SOC_DIR}/${ARCH}/${SOC_PATH}/include - ${SOC_DIR}/${ARCH}/${SOC_FAMILY}/include include include/drivers ${PROJECT_BINARY_DIR}/include/generated @@ -70,6 +67,18 @@ zephyr_include_directories( ${STDINCLUDE} ) +# Don't add non-existing include directories, it creates noise and +# warnings in some tooling +foreach(optional_include_dir + ${SOC_DIR}/${ARCH}/${SOC_PATH} + ${SOC_DIR}/${ARCH}/${SOC_PATH}/include + ${SOC_DIR}/${ARCH}/${SOC_FAMILY}/include + ) + if(EXISTS ${optional_include_dir}) + zephyr_include_directories(${optional_include_dir}) + endif() +endforeach() + zephyr_compile_definitions( KERNEL __ZEPHYR__=1