Fix CMakeLists so Platformio works properly again

This commit is contained in:
Hendrik Sauer 2021-06-22 16:14:13 +02:00 committed by Patrick Rathje
parent 5c47dbb2e0
commit ca90702af6
2 changed files with 18 additions and 13 deletions

View File

@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.13.1)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(test)
if(DEFINED NATIVE_POSIX)
include(FetchContent)
FetchContent_Declare(
exposure-notification
@ -15,4 +16,8 @@ endif ()
target_include_directories(app PUBLIC ${exposure-notification_SOURCE_DIR}/include)
FILE(GLOB app_sources ../src/*.c* ${exposure-notification_SOURCE_DIR}/src/*.c*)
else()
FILE(GLOB app_sources ../src/*.c*)
endif()
target_sources(app PRIVATE ${app_sources})

View File

@ -1,5 +1,5 @@
#!/bin/bash
rm -rf build
west build -b native_posix_64 . -- -DCMAKE_C_FLAGS="-DNATIVE_POSIX -I../../include/tls_config -DDISPLAY"
west build -b native_posix_64 . -- -DCMAKE_C_FLAGS="-DNATIVE_POSIX -I../../include/tls_config -DDISPLAY" -DNATIVE_POSIX=1
echo "Run ./build/zephyr/zephyr.elf"