From 7a7914c7a9d98b1c17b473d8b3bbf805dc5e8e00 Mon Sep 17 00:00:00 2001 From: Hendrik Sauer Date: Thu, 17 Jun 2021 11:30:57 +0200 Subject: [PATCH] Improve native build --- zephyr/CMakeLists.txt | 14 +++++++++++++- zephyr/build_native.sh | 2 -- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 258e99a..6575a90 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -2,5 +2,17 @@ cmake_minimum_required(VERSION 3.13.1) include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(test) -FILE(GLOB app_sources ../src/*.c*) +include(FetchContent) +FetchContent_Declare( + exposure-notification + GIT_REPOSITORY https://github.com/prathje/exposure-notification + GIT_TAG origin/main +) +FetchContent_GetProperties(exposure-notification) +if (NOT exposure-notification_POPULATED) + FetchContent_Populate(exposure-notification) +endif () +target_include_directories(app PUBLIC ${exposure-notification_SOURCE_DIR}/include) + +FILE(GLOB app_sources ../src/*.c* ${exposure-notification_SOURCE_DIR}/src/*.c*) target_sources(app PRIVATE ${app_sources}) diff --git a/zephyr/build_native.sh b/zephyr/build_native.sh index f0c850c..abb3f4f 100755 --- a/zephyr/build_native.sh +++ b/zephyr/build_native.sh @@ -1,7 +1,5 @@ #!/bin/bash rm -rf build -cp ../.pio/libdeps/nrf52840_dk/exposure-notification/*/exposure-notification.* ../src west build -b native_posix_64 . -- -DCMAKE_C_FLAGS="-DNATIVE_POSIX -I../../include/tls_config -DDISPLAY" -rm ../src/exposure-notification.c ../src/exposure-notification.h echo "Run ./build/zephyr/zephyr.elf --bt-dev=hci0" \ No newline at end of file