Skip to content

Commit 87a9379

Browse files
committed
refactor(uthash): move to its own library
We will need uthash outside of ocre-core. Move it to its own library. Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
1 parent 2110b84 commit 87a9379

8 files changed

Lines changed: 21 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ set(WAMR_BUILD_PLATFORM linux)
1515

1616
include (src/samples/demo/demo_containers.cmake)
1717

18+
# uthash
19+
add_subdirectory(src/uthash)
20+
1821
# core
1922
add_subdirectory(src/ocre)
2023
add_subdirectory(src/runtime)

src/ocre/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ target_sources(OcreCore
5858
include/ocre/build_info.h
5959
)
6060

61-
target_link_libraries(OcreCore PUBLIC
61+
target_link_libraries(OcreCore
62+
PUBLIC
63+
uthash
6264
OcrePlatform
6365
OcreRuntime
6466
OcreRuntimeWamr

src/ocre/context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <string.h>
1414
#include <sys/stat.h>
1515

16-
#include "uthash/utlist.h"
16+
#include <uthash/utlist.h>
1717

1818
#include <ocre/ocre.h>
1919
#include <ocre/platform/config.h>

src/ocre/ocre.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
#include <pthread.h>
1515
#include <sys/stat.h>
1616

17+
#include <uthash/utlist.h>
18+
1719
#include <ocre/ocre.h>
1820
#include <ocre/platform/log.h>
1921
#include <ocre/build_info.h>
2022
#include <ocre/runtime/wamr/wasip1.h>
2123

2224
#include "context.h"
2325
#include "util/rm_rf.h"
24-
#include "uthash/utlist.h"
2526

2627
#include "commit_id.h"
2728
#include "version.h"

src/uthash/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
add_library(uthash INTERFACE)
7+
8+
target_include_directories(uthash
9+
INTERFACE
10+
include
11+
)

zephyr/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ set(CMAKE_CXX_STANDARD 17)
1717

1818
include (wamr.cmake)
1919

20+
add_subdirectory(../src/uthash "uthash")
2021
add_subdirectory(../src/ocre "ocre-core")
2122
add_subdirectory(../src/runtime "ocre-runtime")
2223
add_subdirectory(../src/runtime/wamr-wasip1 "ocre-runtime-wamr-wasip1")

0 commit comments

Comments
 (0)