# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(spi_flash)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})

# Get the current system time
string(TIMESTAMP COMPILE_TIME "%Y-%m-%d %H:%M:%S")

# Define compilation time macro
set(COMPILE_TIME "${COMPILE_TIME}" CACHE STRING "Compile time" FORCE)

# Pass the compilation time as a macro to the compiler
add_compile_definitions(COMPILE_TIME="${COMPILE_TIME}")

# Place custom external flash const data section in nRF52840 QSPI XIP window.
zephyr_linker_sources(SECTIONS src/extflash_rodata.ld)
