arch: Simplify private header include path configuration.
When compiling the components under the arch directory, the compiler include paths for arch and kernel private headers need to be specified. This was previously done by adding 'zephyr_library_include_directories' to CMakeLists.txt file for every component under the arch directory, and this resulted in a significant amount of duplicate code. This commit uses the CMake 'include_directories' command in the root CMakeLists.txt to simplify specification of the private header include paths for all the arch components. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
parent
37d6241ecf
commit
7bcfdadf81
15 changed files with 28 additions and 73 deletions
|
@ -2,5 +2,10 @@
|
|||
|
||||
add_definitions(-D__ZEPHYR_SUPERVISOR__)
|
||||
|
||||
include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/${ARCH}/include
|
||||
)
|
||||
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(${ARCH_DIR}/${ARCH} arch/${ARCH})
|
||||
|
|
|
@ -28,10 +28,5 @@ zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.S)
|
|||
zephyr_library_sources_ifdef(CONFIG_ARC_CONNECT arc_connect.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_SMP arc_smp.c)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/arc/include
|
||||
)
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_ARC_CORE_MPU mpu)
|
||||
add_subdirectory_ifdef(CONFIG_ARC_SECURE_FIRMWARE secureshield)
|
||||
|
|
|
@ -4,8 +4,3 @@ zephyr_library()
|
|||
|
||||
zephyr_library_sources_if_kconfig(arc_core_mpu.c)
|
||||
zephyr_library_sources_if_kconfig(arc_mpu.c)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/arc/include
|
||||
)
|
||||
|
|
|
@ -10,8 +10,3 @@ zephyr_library_sources(
|
|||
arc_secure.S
|
||||
secure_sys_services.c
|
||||
)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/arc/include
|
||||
)
|
||||
|
|
|
@ -20,11 +20,6 @@ zephyr_library_sources(
|
|||
prep_c.c
|
||||
)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/arm/include
|
||||
)
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_GEN_SW_ISR_TABLE isr_wrapper.S)
|
||||
zephyr_library_sources_ifdef(CONFIG_CPLUSPLUS __aeabi_atexit.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)
|
||||
|
|
|
@ -15,8 +15,3 @@ zephyr_linker_sources_ifdef(CONFIG_SW_VECTOR_RELAY
|
|||
RAM_SECTIONS
|
||||
vt_pointer_section.ld
|
||||
)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/arm/include
|
||||
)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_sources(arm_core_cmse.c)
|
||||
zephyr_library()
|
||||
|
||||
zephyr_library_sources(arm_core_cmse.c)
|
||||
|
|
|
@ -32,4 +32,8 @@ zephyr_link_libraries_ifdef(CONFIG_ARM_FIRMWARE_USES_SECURE_ENTRY_FUNCS
|
|||
${CMAKE_BINARY_DIR}/${CONFIG_ARM_ENTRY_VENEERS_LIB_NAME}
|
||||
)
|
||||
|
||||
zephyr_sources_ifdef(CONFIG_ARM_SECURE_FIRMWARE arm_core_tz.c)
|
||||
if(CONFIG_ARM_SECURE_FIRMWARE)
|
||||
zephyr_library()
|
||||
|
||||
zephyr_library_sources(arm_core_tz.c)
|
||||
endif()
|
||||
|
|
|
@ -9,8 +9,3 @@ zephyr_library_sources(
|
|||
reboot.c
|
||||
stacks.c
|
||||
)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/arm/include
|
||||
)
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(CONFIG_GEN_ISR_TABLES OR CONFIG_EXECUTION_BENCHMARKING)
|
||||
zephyr_library()
|
||||
|
||||
zephyr_library_sources_ifdef(
|
||||
CONFIG_GEN_ISR_TABLES
|
||||
isr_tables.c
|
||||
sw_isr_common.c
|
||||
)
|
||||
|
||||
zephyr_library_sources_ifdef(
|
||||
CONFIG_EXECUTION_BENCHMARKING
|
||||
timing_info_bench.c
|
||||
)
|
||||
endif()
|
||||
|
||||
# Put functions and data in their own binary sections so that ld can
|
||||
# garbage collect them
|
||||
zephyr_cc_option(-ffunction-sections -fdata-sections)
|
||||
|
||||
zephyr_sources_ifdef(
|
||||
CONFIG_GEN_ISR_TABLES
|
||||
isr_tables.c
|
||||
sw_isr_common.c
|
||||
)
|
||||
|
||||
zephyr_sources_ifdef(
|
||||
CONFIG_EXECUTION_BENCHMARKING
|
||||
timing_info_bench.c
|
||||
)
|
||||
|
||||
zephyr_linker_sources_ifdef(CONFIG_GEN_ISR_TABLES
|
||||
SECTIONS
|
||||
isr_tables.ld
|
||||
|
@ -29,8 +33,3 @@ zephyr_linker_sources_ifdef(CONFIG_NOCACHE_MEMORY
|
|||
RAM_SECTIONS
|
||||
nocache.ld
|
||||
)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/${ARCH}/include
|
||||
)
|
||||
|
|
|
@ -16,8 +16,3 @@ zephyr_library_sources(
|
|||
)
|
||||
|
||||
zephyr_library_sources_if_kconfig(irq_offload.c)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/nios2/include
|
||||
)
|
||||
|
|
|
@ -14,8 +14,3 @@ zephyr_library_sources(
|
|||
)
|
||||
|
||||
zephyr_library_sources_if_kconfig(irq_offload.c)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/riscv/include
|
||||
)
|
||||
|
|
|
@ -19,11 +19,6 @@ zephyr_library_sources_if_kconfig(x86_mmu.c)
|
|||
|
||||
zephyr_library_sources_ifdef(CONFIG_X86_VERY_EARLY_CONSOLE early_serial.c)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/x86/include
|
||||
)
|
||||
|
||||
if(CONFIG_X86_64)
|
||||
include(intel64.cmake)
|
||||
else()
|
||||
|
|
|
@ -16,9 +16,4 @@ zephyr_library_sources_ifndef(CONFIG_ATOMIC_OPERATIONS_C atomic.S)
|
|||
zephyr_library_sources_ifdef(CONFIG_XTENSA_USE_CORE_CRT1 crt1.S)
|
||||
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/xtensa/include
|
||||
)
|
||||
|
||||
add_subdirectory(startup)
|
||||
|
|
|
@ -14,9 +14,4 @@ if(CONFIG_XTENSA_RESET_VECTOR)
|
|||
memerror-vector.S
|
||||
memctl_default.S
|
||||
)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/xtensa/include
|
||||
)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue