1# SPDX-License-Identifier: Apache-2.0
2
3cmake_minimum_required(VERSION 3.20.0)
4if(BOARD STREQUAL unit_testing)
5  find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
6  project(base)
7
8  # This test suite depends on having this CONFIG_ value, so define it
9  add_definitions( -DCONFIG_BUGxxxxx )
10  target_sources(testbinary PRIVATE src/main.c)
11else()
12  find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
13  project(base)
14
15  if(CONFIG_CPP)
16    message(STATUS "adding main.cpp")
17    target_sources(app PRIVATE src/main.cpp)
18  else()
19    target_sources(app PRIVATE src/main.c)
20
21    target_sources_ifdef(CONFIG_USERSPACE app PRIVATE src/main_userspace.c)
22  endif()
23endif()
24