2023-08-23 19:42:12 +08:00
|
|
|
# Copyright (c) 2023 Nordic Semiconductor ASA
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
set(zephyr_build_path ${CMAKE_BINARY_DIR}/zephyr)
|
2023-08-23 20:00:31 +08:00
|
|
|
get_property(CCACHE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
|
2023-08-23 19:42:12 +08:00
|
|
|
|
2023-09-20 18:35:15 +08:00
|
|
|
target_link_options(native_simulator INTERFACE
|
|
|
|
"-T ${ZEPHYR_BASE}/boards/posix/common/natsim_linker_script.ld")
|
|
|
|
|
2023-08-23 19:42:12 +08:00
|
|
|
set(nsi_config_content
|
|
|
|
${nsi_config_content}
|
|
|
|
"NSI_BUILD_OPTIONS:=$<JOIN:$<TARGET_PROPERTY:native_simulator,INTERFACE_COMPILE_OPTIONS>,\ >"
|
|
|
|
"NSI_BUILD_PATH:=${zephyr_build_path}/NSI"
|
2023-08-23 20:00:31 +08:00
|
|
|
"NSI_CC:=${CCACHE} ${CMAKE_C_COMPILER}"
|
2023-08-23 22:56:10 +08:00
|
|
|
"NSI_OBJCOPY:=${CMAKE_OBJCOPY}"
|
2023-08-23 19:42:12 +08:00
|
|
|
"NSI_EMBEDDED_CPU_SW:=${zephyr_build_path}/${KERNEL_ELF_NAME}"
|
|
|
|
"NSI_EXE:=${zephyr_build_path}/${KERNEL_EXE_NAME}"
|
|
|
|
"NSI_EXTRA_SRCS:=$<JOIN:$<TARGET_PROPERTY:native_simulator,INTERFACE_SOURCES>,\ >"
|
|
|
|
"NSI_LINK_OPTIONS:=$<JOIN:$<TARGET_PROPERTY:native_simulator,INTERFACE_LINK_OPTIONS>,\ >"
|
2023-08-24 18:55:53 +08:00
|
|
|
"NSI_EXTRA_LIBS:=$<JOIN:$<TARGET_PROPERTY:native_simulator,RUNNER_LINK_LIBRARIES>,\ >"
|
2023-08-23 19:42:12 +08:00
|
|
|
"NSI_PATH:=${NSI_DIR}/"
|
|
|
|
)
|
|
|
|
|
|
|
|
string(REPLACE ";" "\n" nsi_config_content "${nsi_config_content}")
|
|
|
|
|
|
|
|
file(GENERATE OUTPUT "${zephyr_build_path}/NSI/nsi_config"
|
|
|
|
CONTENT "${nsi_config_content}"
|
|
|
|
)
|