Skip to content

Commit 78bb2b2

Browse files
committed
build(supervisor/posix): clean-up
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
1 parent e012efe commit 78bb2b2

4 files changed

Lines changed: 39 additions & 80 deletions

File tree

src/common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ocre)
3131
# Generate build info header file in binary dir for every build
3232
add_custom_command(
3333
OUTPUT include/build_info.h
34-
COMMAND sh -c "echo \"#define OCRE_BUILD_HOST_INFO \\\"$ENV{USER} @ $(uname -a)\\\"\" > include/build_info.h"
34+
COMMAND sh -c "echo \"#define OCRE_BUILD_HOST_INFO \\\"$(whoami) @ $(uname -a)\\\"\" > include/build_info.h"
3535
COMMAND sh -c "echo \"#define OCRE_BUILD_DATE \\\"$(date +'%Y-%m-%d %H:%M:%S %Z')\\\"\" >> include/build_info.h"
3636
VERBATIM
3737
DEPENDS always_rebuild

src/samples/supervisor/posix/CMakeLists.txt

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ cmake_minimum_required(VERSION 3.20.0)
77

88
project (ocre_supervisor)
99

10-
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
11-
find_package(Threads)
10+
add_subdirectory(server)
11+
12+
add_subdirectory(client)
1213

1314
add_executable(ocre_cli
1415
ocre.c
@@ -18,82 +19,5 @@ add_executable(ocre_cli
1819
target_link_libraries(ocre_cli
1920
PRIVATE
2021
OcreShell
21-
)
22-
23-
add_library(OcreClient)
24-
25-
target_sources(OcreClient
26-
PRIVATE
27-
client/client.c
28-
client/context.c
29-
zcbor_helpers.c
30-
zcbor/src/zcbor_encode.c
31-
zcbor/src/zcbor_decode.c
32-
zcbor/src/zcbor_common.c
33-
)
34-
35-
target_include_directories(OcreClient
36-
PUBLIC ../../../ocre/include
37-
PUBLIC ../../../runtime/include
38-
PRIVATE zcbor/include
39-
PRIVATE .
40-
)
41-
42-
43-
target_link_libraries(OcreClient
44-
PUBLIC
45-
OcreCommon
46-
)
47-
48-
# target_link_libraries(OcreCore PUBLIC
49-
# OcrePlatform
50-
# OcreRuntime
51-
# OcreRuntimeWamr
52-
# )
53-
54-
# target_include_directories(OcreCore
55-
# PRIVATE
56-
# ${CMAKE_CURRENT_BINARY_DIR}/include
57-
# PUBLIC
58-
# include
59-
# )
60-
61-
# include (../../cmake/state_information.cmake)
62-
63-
# if(OCRE_IMAGES)
64-
# add_dependencies(OcreCore ${OCRE_IMAGES})
65-
# endif()
66-
67-
# install(TARGETS OcreCore DESTINATION lib)
68-
# install(FILES include/ocre/container.h DESTINATION include/ocre)
69-
# install(FILES include/ocre/library.h DESTINATION include/ocre)
70-
# install(FILES include/ocre/context.h DESTINATION include/ocre)
71-
# install(FILES include/ocre/ocre.h DESTINATION include/ocre)
72-
73-
# ######
74-
75-
target_link_libraries(ocre_cli
76-
PUBLIC
7722
OcreClient
78-
Threads::Threads
7923
)
80-
81-
# target_include_directories(ocre_cli PRIVATE ../../../ocre/include)
82-
# target_include_directories(ocre_cli PRIVATE ../../../runtime/include)
83-
# target_include_directories(ocre_cli PRIVATE ../../../shell/include)
84-
85-
86-
# target_include_directories(ocre_cli PRIVATE zcbor/include)
87-
88-
# target_link_libraries(OcreShell
89-
# PUBLIC
90-
# OcreCore
91-
# )
92-
93-
94-
95-
96-
# add_definitions(-DZCBOR_VERBOSE)
97-
98-
# add_definitions(-DZCBOR_CANONICAL)
99-
add_subdirectory(server)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# @copyright Copyright (c) contributors to Project Ocre,
2+
# which has been established as Project Ocre a Series of LF Projects, LLC
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
cmake_minimum_required(VERSION 3.20.0)
7+
8+
add_library(OcreClient)
9+
10+
target_sources(OcreClient
11+
PRIVATE
12+
client.c
13+
context.c
14+
../zcbor_helpers.c
15+
../zcbor/src/zcbor_encode.c
16+
../zcbor/src/zcbor_decode.c
17+
../zcbor/src/zcbor_common.c
18+
)
19+
20+
target_include_directories(OcreClient
21+
PUBLIC
22+
../../../../ocre/include
23+
../../../../runtime/include
24+
PRIVATE
25+
../zcbor/include
26+
..
27+
)
28+
29+
target_link_libraries(OcreClient
30+
PUBLIC
31+
OcreCommon
32+
)

src/samples/supervisor/posix/server/waiters.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <unistd.h>
1212
#include <stdio.h>
1313
#include <stdint.h>
14+
#include <stdbool.h>
1415
#include <poll.h>
1516

1617
#include <sys/socket.h>
@@ -183,6 +184,8 @@ static void *socket_thread(void *arg)
183184

184185
close(pfds[i].fd);
185186

187+
// TODO: remove from client list
188+
186189
pthread_mutex_lock(&waiter->mutex);
187190

188191
pthread_mutex_unlock(&waiter->mutex);

0 commit comments

Comments
 (0)