Skip to content

Commit

Permalink
WIP server as individual project
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasWoodtli committed Sep 5, 2024
1 parent 81430c2 commit a15fe00
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ jobs:
env:
CC: ${{ matrix.compiler }}

- name: Build examples for integration tests
run: |
for example in "server"
do
echo "Building example ${example}"
tools/ci/run_ci.sh \
--run-clean \
--run-build \
--sanitizer ${{ matrix.sanitizer }} \
--source-directory examples/${example} \
--build-directory build-wakaama-${example}
done
env:
CC: ${{ matrix.compiler }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ add_compile_definitions(_POSIX_C_SOURCE=200809)
add_subdirectory(bootstrap_server)
add_subdirectory(client)
add_subdirectory(lightclient)
add_subdirectory(server)

15 changes: 8 additions & 7 deletions examples/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ cmake_minimum_required(VERSION 3.21)

project(lwm2mserver C)

include(../../wakaama.cmake)
set(WAKAAMA_MODE_SERVER ON)
set(WAKAAMA_CLI ON)
set(WAKAAMA_TRANSPORT POSIX_UDP)
set(WAKAAMA_PLATFORM POSIX)
add_subdirectory(../../ wakaama_lib)

if(WAKAAMA_ENABLE_EXAMPLES AND WAKAAMA_MODE_SERVER)
add_executable(lwm2mserver lwm2mserver.c)
target_compile_definitions(lwm2mserver PRIVATE LWM2M_SERVER_MODE)
target_sources_wakaama(lwm2mserver)
target_sources_shared(lwm2mserver)
endif()
add_executable(lwm2mserver)
target_sources(lwm2mserver PRIVATE lwm2mserver.c)
target_link_libraries(lwm2mserver PRIVATE wakaama_static)
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Lwm2mServer(HelperBase):

def __init__(self, arguments="", timeout=3, encoding="utf8"):
self.pexpectobj = pexpect.spawn(REPO_BASE_PATH +
"/build-presets/server/examples/server/lwm2mserver " +
"/build-wakaama-server/lwm2mserver " +
arguments,
encoding=encoding,
timeout=timeout)
Expand Down

0 comments on commit a15fe00

Please sign in to comment.