1if(CONFIG_XTENSA_HAL)
2
3  zephyr_interface_library_named(XTENSA_HAL)
4
5  target_include_directories(XTENSA_HAL INTERFACE include)
6
7  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/zephyr/soc/${SOC_NAME})
8    target_include_directories(XTENSA_HAL INTERFACE
9                               ${CMAKE_CURRENT_LIST_DIR}/zephyr/soc/${SOC_NAME}/)
10  elseif(EXISTS ${CMAKE_CURRENT_LIST_DIR}/zephyr/soc/${SOC_TOOLCHAIN_NAME})
11    target_include_directories(XTENSA_HAL INTERFACE
12                               ${CMAKE_CURRENT_LIST_DIR}/zephyr/soc/${SOC_TOOLCHAIN_NAME}/)
13  endif()
14
15  zephyr_library_named(modules_xtensa_hal)
16
17  zephyr_include_directories(
18    include
19    )
20
21  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/zephyr/soc/${SOC_NAME})
22    zephyr_include_directories(XTENSA_HAL INTERFACE
23                               ${CMAKE_CURRENT_LIST_DIR}/zephyr/soc/${SOC_NAME}/)
24  elseif(EXISTS ${CMAKE_CURRENT_LIST_DIR}/zephyr/soc/${SOC_TOOLCHAIN_NAME})
25    zephyr_include_directories(XTENSA_HAL INTERFACE
26                               ${CMAKE_CURRENT_LIST_DIR}/zephyr/soc/${SOC_TOOLCHAIN_NAME}/)
27  endif()
28
29  zephyr_library_sources(
30    src/hal/attribute.c
31    src/hal/cache_asm.S
32    src/hal/cache.c
33    src/hal/clock.S
34    src/hal/coherence.c
35    src/hal/debug.c
36    src/hal/debug_hndlr.S
37    src/hal/disass.c
38    src/hal/int_asm.S
39    src/hal/interrupts.c
40    src/hal/memcopy.S
41    src/hal/mem_ecc_parity.S
42    src/hal/misc.c
43    src/hal/miscellaneous.S
44    src/hal/mmu.c
45    src/hal/mp_asm.S
46    src/hal/set_region_translate.c
47    src/hal/state_asm.S
48    src/hal/state.c
49    src/hal/syscache_asm.S
50    src/hal/windowspill_asm.S
51    )
52
53  zephyr_library_link_libraries(XTENSA_HAL)
54  target_link_libraries(XTENSA_HAL INTERFACE zephyr_interface)
55
56endif()
57