Skip to content

Commit

Permalink
cmake: Use server mode as default
Browse files Browse the repository at this point in the history
Server mode is enabled, if no mode (client, server or bootstrap-server)
is selected. A warning is submitted to inform the user of Wakaama about
the default. This simplifies testing and CI.
  • Loading branch information
LukasWoodtli committed Sep 25, 2024
1 parent 47d9f73 commit 2965550
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/ci/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function run_build() {

echo "Default build"
${OPT_WRAPPER_CMD} cmake -GNinja -S ${OPT_SOURCE_DIRECTORY} -B build-wakaama \
-DWAKAAMA_MODE_SERVER=ON -DWAKAAMA_PLATFORM=POSIX ${CMAKE_ARGS}
-DWAKAAMA_PLATFORM=POSIX ${CMAKE_ARGS}
${OPT_WRAPPER_CMD} cmake --build build-wakaama

# CMake presets
Expand Down
8 changes: 8 additions & 0 deletions wakaama.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ option(WAKAAMA_MODE_SERVER "Enable LWM2M Server interfaces" OFF)
option(WAKAAMA_MODE_BOOTSTRAP_SERVER "Enable LWM2M Bootstrap Server interfaces" OFF)
option(WAKAAMA_MODE_CLIENT "Enable LWM2M Client interfaces" OFF)

if(NOT WAKAAMA_MODE_SERVER
AND NOT WAKAAMA_MODE_BOOTSTRAP_SERVER
AND NOT WAKAAMA_MODE_CLIENT
)
message(WARNING "No mode selected. Defaulting to 'WAKAAMA_MODE_SERVER'")
set(WAKAAMA_MODE_SERVER ON)
endif()

# Client
option(WAKAAMA_CLIENT_INITIATED_BOOTSTRAP "Enable client initiated bootstrap support in a client" OFF)
option(WAKAAMA_CLIENT_LWM2M_V_1_0 "Restrict the client code to use LwM2M version 1.0" OFF)
Expand Down

0 comments on commit 2965550

Please sign in to comment.