diff --git a/arch/CMakeLists.txt b/arch/CMakeLists.txt index 00e3e0035bb79d..1d96abbfe6e87f 100644 --- a/arch/CMakeLists.txt +++ b/arch/CMakeLists.txt @@ -1,2 +1,4 @@ +add_definitions(-D__ZEPHYR_SUPERVISOR__) + add_subdirectory(common) add_subdirectory(${ARCH}) diff --git a/arch/arc/core/CMakeLists.txt b/arch/arc/core/CMakeLists.txt index 1427e063218cd3..135c4df9011ca4 100644 --- a/arch/arc/core/CMakeLists.txt +++ b/arch/arc/core/CMakeLists.txt @@ -1,4 +1,6 @@ -zephyr_sources( +zephyr_library() + +zephyr_library_sources( thread.c thread_entry_wrapper.S cpu_idle.S @@ -17,9 +19,9 @@ zephyr_sources( vector_table.c ) -zephyr_sources_ifdef(CONFIG_ARC_FIRQ fast_irq.S) +zephyr_library_sources_ifdef(CONFIG_ARC_FIRQ fast_irq.S) -zephyr_sources_if_kconfig(irq_offload.c) -zephyr_sources_ifdef(CONFIG_ATOMIC_OPERATIONS_CUSTOM atomic.c) +zephyr_library_sources_if_kconfig(irq_offload.c) +zephyr_library_sources_ifdef(CONFIG_ATOMIC_OPERATIONS_CUSTOM atomic.c) add_subdirectory_ifdef(CONFIG_CPU_HAS_MPU mpu) -zephyr_sources_ifdef(CONFIG_USERSPACE userspace.S) +zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.S) diff --git a/arch/arc/core/mpu/CMakeLists.txt b/arch/arc/core/mpu/CMakeLists.txt index 1bc394ffa237f0..f8ef61dc78771d 100644 --- a/arch/arc/core/mpu/CMakeLists.txt +++ b/arch/arc/core/mpu/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_if_kconfig(arc_core_mpu.c) -zephyr_sources_if_kconfig(arc_mpu.c) +zephyr_library_ifdef(CONFIG_ARC_CORE_MPU) + +zephyr_library_sources_if_kconfig(arc_core_mpu.c) +zephyr_library_sources_if_kconfig(arc_mpu.c) diff --git a/arch/arm/core/CMakeLists.txt b/arch/arm/core/CMakeLists.txt index 4e0ecfcf53e9fe..7d20b1a0991618 100644 --- a/arch/arm/core/CMakeLists.txt +++ b/arch/arm/core/CMakeLists.txt @@ -1,4 +1,6 @@ -zephyr_sources( +zephyr_library() + +zephyr_library_sources( exc_exit.S irq_init.c swap.c @@ -13,11 +15,11 @@ zephyr_sources( thread_abort.c ) -zephyr_sources_ifdef(CONFIG_GEN_SW_ISR_TABLE isr_wrapper.S) -zephyr_sources_ifdef(CONFIG_CPLUSPLUS __aeabi_atexit.c) -zephyr_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c) -zephyr_sources_ifdef(CONFIG_CPU_CORTEX_M0 irq_relay.S) -zephyr_sources_ifdef(CONFIG_USERSPACE userspace.S) +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) +zephyr_library_sources_ifdef(CONFIG_CPU_CORTEX_M0 irq_relay.S) +zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.S) add_subdirectory_ifdef(CONFIG_CPU_CORTEX_M cortex_m) add_subdirectory_ifdef(CONFIG_CPU_HAS_MPU cortex_m/mpu) diff --git a/arch/arm/core/cortex_m/CMakeLists.txt b/arch/arm/core/cortex_m/CMakeLists.txt index 6a14d26b6b43db..adf8e9a281e7d1 100644 --- a/arch/arm/core/cortex_m/CMakeLists.txt +++ b/arch/arm/core/cortex_m/CMakeLists.txt @@ -1,4 +1,6 @@ -zephyr_sources( +zephyr_library() + +zephyr_library_sources( vector_table.S reset.S nmi_on_reset.S diff --git a/arch/arm/core/cortex_m/mpu/CMakeLists.txt b/arch/arm/core/cortex_m/mpu/CMakeLists.txt index 3a7d2d1719b7f5..5598375c045801 100644 --- a/arch/arm/core/cortex_m/mpu/CMakeLists.txt +++ b/arch/arm/core/cortex_m/mpu/CMakeLists.txt @@ -1,3 +1,5 @@ -zephyr_sources_ifdef(CONFIG_ARM_CORE_MPU arm_core_mpu.c) -zephyr_sources_if_kconfig( arm_mpu.c) -zephyr_sources_if_kconfig( nxp_mpu.c) +zephyr_library_ifdef(CONFIG_ARM_CORE_MPU) + +zephyr_library_sources_ifdef(CONFIG_ARM_CORE_MPU arm_core_mpu.c) +zephyr_library_sources_if_kconfig( arm_mpu.c) +zephyr_library_sources_if_kconfig( nxp_mpu.c) diff --git a/arch/x86/core/CMakeLists.txt b/arch/x86/core/CMakeLists.txt index 3fd44567e0eb4d..7fef31b0dc37c2 100644 --- a/arch/x86/core/CMakeLists.txt +++ b/arch/x86/core/CMakeLists.txt @@ -1,3 +1,5 @@ +zephyr_library() + if (COMPILER STREQUAL "clang") # We rely on GAS for assembling, so don't use the integrated assembler zephyr_compile_options_ifndef(CONFIG_X86_IAMCU $<$:-no-integrated-as>) @@ -5,7 +7,7 @@ endif() zephyr_compile_options($<$:-Wa,--divide>) -zephyr_sources( +zephyr_library_sources( cache.c cache_s.S cpuhalt.c @@ -19,11 +21,11 @@ zephyr_sources( thread.c ) -zephyr_sources_if_kconfig( irq_offload.c) -zephyr_sources_if_kconfig( x86_mmu.c) -zephyr_sources_if_kconfig( reboot_rst_cnt.c) -zephyr_sources_ifdef(CONFIG_FP_SHARING float.c) -zephyr_sources_ifdef(CONFIG_X86_USERSPACE userspace.S) +zephyr_library_sources_if_kconfig( irq_offload.c) +zephyr_library_sources_if_kconfig( x86_mmu.c) +zephyr_library_sources_if_kconfig( reboot_rst_cnt.c) +zephyr_library_sources_ifdef(CONFIG_FP_SHARING float.c) +zephyr_library_sources_ifdef(CONFIG_X86_USERSPACE userspace.S) # Last since we declare default exception handlers here -zephyr_sources(fatal.c) +zephyr_library_sources(fatal.c)