Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
joelguittet committed May 13, 2024
1 parent bf87bd1 commit 5ab3ef1
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ elseif (CONFIG_MENDER_LOG_LEVEL STREQUAL "debug")
else()
message(FATAL_ERROR "Invalid log level '${CONFIG_MENDER_LOG_LEVEL}'")
endif()
if (NOT CONFIG_MENDER_PLATFORM_FLASH_TYPE)
message(STATUS "Using default 'generic/weak' platform flash implementation")
set(CONFIG_MENDER_PLATFORM_FLASH_TYPE "generic/weak")
else()
message(STATUS "Using custom '${CONFIG_MENDER_PLATFORM_FLASH_TYPE}' platform flash implementation")
endif()
if (NOT CONFIG_MENDER_PLATFORM_LOG_TYPE)
message(STATUS "Using default 'generic/weak' platform log implementation")
set(CONFIG_MENDER_PLATFORM_LOG_TYPE "generic/weak")
Expand All @@ -111,12 +117,6 @@ if (NOT CONFIG_MENDER_PLATFORM_NET_TYPE)
else()
message(STATUS "Using custom '${CONFIG_MENDER_PLATFORM_NET_TYPE}' platform network implementation")
endif()
if (NOT CONFIG_MENDER_PLATFORM_OTA_TYPE)
message(STATUS "Using default 'generic/weak' platform OTA implementation")
set(CONFIG_MENDER_PLATFORM_OTA_TYPE "generic/weak")
else()
message(STATUS "Using custom '${CONFIG_MENDER_PLATFORM_OTA_TYPE}' platform OTA implementation")
endif()
if (NOT CONFIG_MENDER_PLATFORM_RTOS_TYPE)
message(STATUS "Using default 'generic/weak' platform RTOS implementation")
set(CONFIG_MENDER_PLATFORM_RTOS_TYPE "generic/weak")
Expand Down Expand Up @@ -184,17 +184,22 @@ file(GLOB SOURCES_TEMP
"${CMAKE_CURRENT_LIST_DIR}/platform/storage/${CONFIG_MENDER_PLATFORM_STORAGE_TYPE}/src/mender-storage.c"
"${CMAKE_CURRENT_LIST_DIR}/platform/tls/${CONFIG_MENDER_PLATFORM_TLS_TYPE}/src/mender-tls.c"
)
if(CONFIG_MENDER_CLIENT_ADD_ON_CONFIGURE)
if (CONFIG_MENDER_PLATFORM_NET_TYPE STREQUAL "zephyr")
list(APPEND SOURCES_TEMP
"${CMAKE_CURRENT_LIST_DIR}/platform/net/${CONFIG_MENDER_PLATFORM_NET_TYPE}/src/mender-net.c"
)
endif()
if (CONFIG_MENDER_CLIENT_ADD_ON_CONFIGURE)
list(APPEND SOURCES_TEMP
"${CMAKE_CURRENT_LIST_DIR}/add-ons/src/mender-configure.c"
)
endif()
if(CONFIG_MENDER_CLIENT_ADD_ON_INVENTORY)
if (CONFIG_MENDER_CLIENT_ADD_ON_INVENTORY)
list(APPEND SOURCES_TEMP
"${CMAKE_CURRENT_LIST_DIR}/add-ons/src/mender-inventory.c"
)
endif()
if(CONFIG_MENDER_CLIENT_ADD_ON_TROUBLESHOOT)
if (CONFIG_MENDER_CLIENT_ADD_ON_TROUBLESHOOT)
list(APPEND SOURCES_TEMP
"${CMAKE_CURRENT_LIST_DIR}/add-ons/src/mender-troubleshoot.c"
"${CMAKE_CURRENT_LIST_DIR}/platform/net/${CONFIG_MENDER_PLATFORM_NET_TYPE}/src/mender-websocket.c"
Expand All @@ -203,13 +208,10 @@ endif()
target_sources(mender-mcu-client PRIVATE ${SOURCES_TEMP})

# Add include directories
include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
include_directories(${CMAKE_CURRENT_LIST_DIR}/platform/flash/${CONFIG_MENDER_PLATFORM_FLASH_TYPE}/include)
include_directories(${CMAKE_CURRENT_LIST_DIR}/platform/log/${CONFIG_MENDER_PLATFORM_LOG_TYPE}/include)
include_directories(${CMAKE_CURRENT_LIST_DIR}/platform/net/${CONFIG_MENDER_PLATFORM_NET_TYPE}/include)
include_directories(${CMAKE_CURRENT_LIST_DIR}/platform/rtos/${CONFIG_MENDER_PLATFORM_RTOS_TYPE}/include)
include_directories(${CMAKE_CURRENT_LIST_DIR}/platform/storage/${CONFIG_MENDER_PLATFORM_STORAGE_TYPE}/include)
include_directories(${CMAKE_CURRENT_LIST_DIR}/platform/tls/${CONFIG_MENDER_PLATFORM_TLS_TYPE}/include)
target_include_directories(mender-mcu-client PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
if (CONFIG_MENDER_PLATFORM_NET_TYPE STREQUAL "zephyr")
target_include_directories(mender-mcu-client PRIVATE ${CMAKE_CURRENT_LIST_DIR}/platform/net/${CONFIG_MENDER_PLATFORM_NET_TYPE}/include)
endif()

# Define version
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/VERSION" MENDER_CLIENT_VERSION)
Expand Down

0 comments on commit 5ab3ef1

Please sign in to comment.