Skip to content

Commit b16fb04

Browse files
committed
autodetect platform
1 parent 0e59b71 commit b16fb04

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ include(${CMAKE_DIR}/supported_platforms.cmake)
3131
# Package options
3232
#------------------------------------------------------------------------------
3333
option(UZMTP_ENABLE_TESTING "build libuzmtp tests" OFF)
34-
set(UZMTP_PLATFORM "LINUX" CACHE STRING "Host operating system [${SUPPORTED_PLATFORMS}]")
3534

36-
if(UZMTP_PLATFORM STREQUAL ZEPHYR)
35+
#------------------------------------------------------------------------------
36+
# Platform detection
37+
#------------------------------------------------------------------------------
38+
if(DEFINED ZEPHYR_BASE)
39+
message(STATUS "Detected Zephyr platform")
3740
include(${CMAKE_DIR}/build_zephyr.cmake)
38-
elseif(UZMTP_PLATFORM STREQUAL LINUX)
41+
else()
42+
message(STATUS "Assuming Linux platform")
3943
include(${CMAKE_DIR}/build_linux.cmake)
4044
endif()

apps/demo/prj.conf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_LIBUZMTP=y
22
CONFIG_LIBUZMTP_LOG_LEVEL_DBG=y
3-
CONFIG_NATIVE_POSIX_CONSOLE=y
43
CONFIG_MINIMAL_LIBC_MALLOC=y
54
CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE=2048
65
CONFIG_MAIN_STACK_SIZE=2048
@@ -35,7 +34,4 @@ CONFIG_LOG_PRINTK=y
3534
CONFIG_LOG_DEFAULT_LEVEL=3
3635
CONFIG_LOG_OVERRIDE_LEVEL=0
3736
CONFIG_LOG_MAX_LEVEL=4
38-
CONFIG_LOG_BACKEND_NATIVE_POSIX=y
39-
CONFIG_LOG_BACKEND_SHOW_COLOR=y
40-
CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=y
4137
CONFIG_LOG_MODE_IMMEDIATE=y

0 commit comments

Comments
 (0)