cmake_minimum_required(VERSION 3.20.0)

set(ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/../nrf9160-slm-driver)

message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
if (NOT CONF_FILE)
  set(CONF_FILE
    ${CMAKE_CURRENT_SOURCE_DIR}/prj.conf)
endif()
set(debug_build_types Debug RelWithDebInfo)
if (CMAKE_BUILD_TYPE IN_LIST debug_build_types OR CONFIG_DEBUG_OPTIMIZATIONS)
  list(APPEND CONF_FILE
    ${CMAKE_CURRENT_SOURCE_DIR}/overlay-debug.conf)
endif()
message(STATUS "CONF_FILE: ${CONF_FILE}")
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Og")
set(CMAKE_C_FLAGS_DEBUG "-Og -g")

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(main C)

target_sources(app PRIVATE
  src/main.c
)
target_include_directories(app PRIVATE src)
