zephyr/tests/drivers/rtc/rtc_api/CMakeLists.txt
Alberto Escolar Piedras d4967b086a tests rtc_api: Define _POSIX_C_SOURCE
This test uses functions which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00

39 lines
722 B
CMake

# Copyright (c) 2022 Bjarki Arge Andreasen
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(rtc_api)
target_sources(app PRIVATE
src/main.c
src/test_time_incrementing.c
src/test_time.c
src/test_y2k.c
)
if(DEFINED CONFIG_RTC_ALARM)
target_sources(app PRIVATE
src/test_alarm_callback.c
src/test_alarm.c
)
endif()
if(DEFINED CONFIG_RTC_UPDATE)
target_sources(app PRIVATE
src/test_update_callback.c
)
endif()
if(DEFINED CONFIG_RTC_CALIBRATION)
target_sources(app PRIVATE
src/test_calibrate.c
)
endif()
target_include_directories(app PRIVATE inc)
target_compile_definitions(app PRIVATE _POSIX_C_SOURCE=200809L)