#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config NCS_SAMPLES_DEFAULTS
	bool "Enable NCS sample default settings"
	default n
	imply LOG
	imply LOG_DEFAULT_MINIMAL
	imply ASSERT
	imply ASSERT_NO_COND_INFO
	imply ASSERT_NO_MSG_INFO
	imply HW_STACK_PROTECTION if ARCH_HAS_STACK_PROTECTION
	imply RESET_ON_FATAL_ERROR if !DEBUG && !BOARD_NATIVE_POSIX && !QEMU_TARGET && !TEST
	help
	  Use the default configuration for NCS samples.

if SOC_SERIES_NRF53X

config NRF700X_RADIO_TEST_COMBO
	bool "Enable radio test combo build for nRF5340"
	depends on SOC_NRF5340_CPUAPP
	select BOARD_ENABLE_CPUNET

config NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE
	bool "Add empty_app_core as a child image"
	depends on SOC_NRF5340_CPUNET
	select PARTITION_MANAGER_ENABLED
	help
	  Add empty_app_core as a child image (application core).
	  Used by samples that run on the network core only.

config NCS_INCLUDE_RPMSG_CHILD_IMAGE
	bool "Include RPMsg sample on netcore"
	depends on SOC_NRF5340_CPUAPP && (BT_HCI_IPC || NRF_802154_SER_HOST || BT_RPC || NRF700X_RADIO_TEST_COMBO)
	select PARTITION_MANAGER_ENABLED
	default y if BT_HCI_IPC || NRF_802154_SER_HOST || BT_RPC || NRF700X_RADIO_TEST_COMBO
	help
	  Enabling this setting will include a network stack to run on the
	  network core and communicate over RPMsg with the application core.
	  The application core does not have access to the radio peripheral.

	  The network core sample to be included depends on the configuration of
	  the application.

	  The following RPMsg samples may be included when this setting is enabled:
	  In order of precedence:
	  - Multiprotocol RPMsg: When both Bluetooth and nRF IEEE 802.15.4 Serialization host are enabled.
	  - HCI RPMsg: When only Bluetooth is enabled
	  - nRF IEEE 802.15.4 Serialization RPMsg: When only nRF IEEE 802.15.4 Serialization host is enabled.
	  - nRF RPC Host: When Bluetooth and Bluetooth serialization over RPC are enabled.
	  - nRF BLE radio test: When both Wi-Fi and BLE radio test are enabled for testing SR co-existence.

config NCS_SAMPLE_REMOTE_SHELL_CHILD_IMAGE
	bool "Add remote_shell sample as a child image"
	depends on SHELL_IPC || IPC_UART
	select PARTITION_MANAGER_ENABLED
	help
	  Add remote_shell as a child image (application core).
	  Used by samples that run on the network core only.

config NCS_SAMPLE_DTM_REMOTE_HCI_CHILD_IMAGE
	bool "Add remote_hci child image for DTM"
	depends on SOC_NRF5340_CPUNET
	select PARTITION_MANAGER_ENABLED
	help
	  Add remote_hci as a child image (application core).
	  Used by the DTM sample to pass HCI commands from
	  application core UART peripheral.

if NCS_INCLUDE_RPMSG_CHILD_IMAGE

config NCS_SAMPLE_MULTIPROTOCOL_RPMSG_CHILD_IMAGE
	bool
	depends on BT_HCI_IPC && NRF_802154_SER_HOST && !BT_RPC && !NRF700X_RADIO_TEST_COMBO
	default y
	help
	  multiprotocol_rpmsg sample as a child image (network core).

config NCS_SAMPLE_HCI_IPC_CHILD_IMAGE
	bool
	depends on BT_HCI_IPC && !NRF_802154_SER_HOST && !BT_RPC && !NRF700X_RADIO_TEST_COMBO
	default y
	help
	  hci_ipc sample as a child image (network core).

config NCS_SAMPLE_802154_RPMSG_CHILD_IMAGE
	bool
	depends on NRF_802154_SER_HOST && !BT_HCI_IPC && !BT_RPC && !NRF700X_RADIO_TEST_COMBO
	default y
	help
	  802154_rpmsg sample as a child image (network core).

config NCS_SAMPLE_RPC_HOST_CHILD_IMAGE
	bool
	depends on BT_RPC && !NRF700X_RADIO_TEST_COMBO
	default y
	help
	  rpc_host sample as a child image (network core).

config NCS_SAMPLE_PERIPHERAL_RADIO_TEST_CHILD_IMAGE
	bool "Add peripheral radio_test sample as a child image"
	depends on NRF700X_RADIO_TEST_COMBO
	default y
	select PARTITION_MANAGER_ENABLED
	help
	  Add peripheral radio_test as a child image (network core).
	  Used by samples that run on the application core only.

endif # NCS_INCLUDE_RPMSG_CHILD_IMAGE

config NCS_SAMPLE_EMPTY_NET_CORE_CHILD_IMAGE
	bool
	depends on SOC_NRF5340_CPUAPP && BOARD_ENABLE_CPUNET
	depends on NRF53_UPGRADE_NETWORK_CORE && !NCS_INCLUDE_RPMSG_CHILD_IMAGE
	default y
	help
	  nRF5340 empty network core sample as a child image (network core).

config NCS_SAMPLE_PROVISIONING_NET_CORE_CHILD_IMAGE
	bool "Add provisioning_image_netcore sample as a child image"
	depends on SOC_NRF5340_CPUAPP && BOARD_ENABLE_CPUNET
	depends on !NCS_INCLUDE_RPMSG_CHILD_IMAGE
	help
	  nRF5340 network core provisioning image as a child image.

endif # SOC_SERIES_NRF53X

menu "Image build variants"

# These are set by CMake, and they need a prompt.
# Keep them in a separate menu to avoid cluttering the top-level menu

config NCS_MCUBOOT_IN_BUILD
	bool "MCUBoot is included in the build [READ ONLY]"
	help
	  Helper option used to communicate to child images that MCUboot is included in the build.

endmenu

rsource "common/Kconfig"
