1# SPDX-License-Identifier: Apache-2.0
2
3cmake_minimum_required(VERSION 3.20.0)
4if(BOARD STREQUAL "unit_testing" OR BOARD STREQUAL "unit_testing/unit_testing")
5  find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
6  project(base)
7
8  target_sources(testbinary PRIVATE src/main.c)
9else()
10  find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
11  project(base)
12
13  if(CONFIG_CPP)
14    message(STATUS "adding main.cpp")
15    target_sources(app PRIVATE src/main.cpp)
16  else()
17    target_sources(app PRIVATE src/main.c)
18  endif()
19endif()
20