From bb3946666f051cbb7d424595db99c577937e4511 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 7 Jul 2020 08:06:27 +0200 Subject: [PATCH] cmake: fix include directories to work with out-of-tree arch Include directories for ${ARCH} is not specified correctly. Several places in Zephyr, the include directories are specified as: ${ZEPHYR_BASE}/arch/${ARCH}/include the correct line is: ${ARCH_DIR}/${ARCH}/include to correctly support out of tree archs. Signed-off-by: Torsten Rasmussen --- arch/CMakeLists.txt | 2 +- kernel/CMakeLists.txt | 2 +- lib/posix/CMakeLists.txt | 2 +- subsys/net/ip/CMakeLists.txt | 2 +- subsys/tracing/CMakeLists.txt | 2 +- subsys/tracing/ctf/CMakeLists.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/CMakeLists.txt b/arch/CMakeLists.txt index 3ebb9ccebff..ef30d760bb8 100644 --- a/arch/CMakeLists.txt +++ b/arch/CMakeLists.txt @@ -4,7 +4,7 @@ add_definitions(-D__ZEPHYR_SUPERVISOR__) include_directories( ${ZEPHYR_BASE}/kernel/include - ${ZEPHYR_BASE}/arch/${ARCH}/include + ${ARCH_DIR}/${ARCH}/include ) add_subdirectory(common) diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 1c2348b944b..60e28cd9aaa 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -63,7 +63,7 @@ target_sources_ifdef( target_include_directories(kernel PRIVATE ${ZEPHYR_BASE}/kernel/include - ${ZEPHYR_BASE}/arch/${ARCH}/include + ${ARCH_DIR}/${ARCH}/include ) add_dependencies(kernel zephyr_generated_headers) diff --git a/lib/posix/CMakeLists.txt b/lib/posix/CMakeLists.txt index 7dfade5ec7e..169ddb2cf10 100644 --- a/lib/posix/CMakeLists.txt +++ b/lib/posix/CMakeLists.txt @@ -30,7 +30,7 @@ endif() zephyr_library_include_directories( ${ZEPHYR_BASE}/kernel/include - ${ZEPHYR_BASE}/arch/${ARCH}/include + ${ARCH_DIR}/${ARCH}/include ) zephyr_library_link_libraries(posix_subsys) diff --git a/subsys/net/ip/CMakeLists.txt b/subsys/net/ip/CMakeLists.txt index b795750c2fa..a04c26ee8d3 100644 --- a/subsys/net/ip/CMakeLists.txt +++ b/subsys/net/ip/CMakeLists.txt @@ -46,7 +46,7 @@ endif() zephyr_library_include_directories( ${ZEPHYR_BASE}/kernel/include - ${ZEPHYR_BASE}/arch/${ARCH}/include + ${ARCH_DIR}/${ARCH}/include ) if(CONFIG_NET_SHELL) diff --git a/subsys/tracing/CMakeLists.txt b/subsys/tracing/CMakeLists.txt index 9b76576663e..f53686f53ec 100644 --- a/subsys/tracing/CMakeLists.txt +++ b/subsys/tracing/CMakeLists.txt @@ -41,7 +41,7 @@ endif() zephyr_include_directories_ifdef( CONFIG_TRACING ${ZEPHYR_BASE}/kernel/include - ${ZEPHYR_BASE}/arch/${ARCH}/include + ${ARCH_DIR}/${ARCH}/include ) zephyr_include_directories_ifdef(CONFIG_TRACING include) diff --git a/subsys/tracing/ctf/CMakeLists.txt b/subsys/tracing/ctf/CMakeLists.txt index ac24dade223..51f7976c26d 100644 --- a/subsys/tracing/ctf/CMakeLists.txt +++ b/subsys/tracing/ctf/CMakeLists.txt @@ -4,7 +4,7 @@ zephyr_sources(ctf_top.c) zephyr_include_directories( ${ZEPHYR_BASE}/kernel/include - ${ZEPHYR_BASE}/arch/${ARCH}/include + ${ARCH_DIR}/${ARCH}/include ) zephyr_include_directories(.)