1# Copyright (c) 2020 Intel Corporation.
2# SPDX-License-Identifier: Apache-2.0
3
4zephyr_library()
5
6zephyr_library_include_directories(
7  ${ZEPHYR_BASE}/kernel/include
8  ${ZEPHYR_BASE}/arch/${ARCH}/include
9  )
10
11zephyr_library_sources(
12  coredump_core.c
13  coredump_memory_regions.c
14  )
15
16zephyr_library_sources_ifdef(
17  CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING
18  coredump_backend_logging.c
19  )
20
21zephyr_library_sources_ifdef(
22  CONFIG_DEBUG_COREDUMP_BACKEND_FLASH_PARTITION
23  coredump_backend_flash_partition.c
24  )
25
26zephyr_library_sources_ifdef(
27  CONFIG_DEBUG_COREDUMP_BACKEND_INTEL_ADSP_MEM_WINDOW
28  coredump_backend_intel_adsp_mem_window.c
29  )
30
31  # @Intent: Set XTENSA_TOOLCHAIN_VARIANT macro required for Xtensa coredump
32if(CONFIG_XTENSA)
33  if(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "zephyr")
34    zephyr_compile_options(-DXTENSA_TOOLCHAIN_VARIANT=1)
35  elseif(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "xcc")
36    zephyr_compile_options(-DXTENSA_TOOLCHAIN_VARIANT=2)
37  elseif(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "espressif")
38    zephyr_compile_options(-DXTENSA_TOOLCHAIN_VARIANT=3)
39  else()
40    zephyr_compile_options(-DXTENSA_TOOLCHAIN_VARIANT=0)
41  endif()
42endif()
43