Skip to content

Commit

Permalink
[Build] nns-edge version info
Browse files Browse the repository at this point in the history
Update build script to set version info.

Signed-off-by: Jaeyun Jung <[email protected]>
  • Loading branch information
jaeyun-jung committed Dec 7, 2023
1 parent 863a42d commit e74b198
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LIST(GET VERSION_LIST 0 VERSION_MAJOR)
LIST(GET VERSION_LIST 1 VERSION_MINOR)
LIST(GET VERSION_LIST 2 VERSION_MICRO)

SET(NNS_EDGE_FLAGS "${NNS_EDGE_FLAGS} -DVERSION_MAJOR=${VERSION_MAJOR} -DVERSION_MINOR=${VERSION_MINOR} -DVERSION_MICRO=${VERSION_MICRO}")
SET(NNS_EDGE_FLAGS "${NNS_EDGE_FLAGS} -DVERSION='\"${VERSION}\"' -DVERSION_MAJOR=${VERSION_MAJOR} -DVERSION_MINOR=${VERSION_MINOR} -DVERSION_MICRO=${VERSION_MICRO}")

# Set as-needed option
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
Expand Down
1 change: 1 addition & 0 deletions packaging/nnstreamer-edge.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Summary: Common library set for nnstreamer-edge
# 1. CMake : ./CMakeLists.txt
# 2. Ubuntu : ./debian/changelog
# 3. Tizen : ./packaging/nnstreamer-edge.spec
# 4. TizenRT : ./tools/build_TizenRT/Makefile
Version: 0.2.5
Release: 1
Group: Machine Learning/ML Framework
Expand Down
5 changes: 5 additions & 0 deletions tests/unittest_nnstreamer-edge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3797,13 +3797,18 @@ TEST(edgeUtil, getVersion)
unsigned int major1, minor1, micro1;
unsigned int major2, minor2, micro2;
uint64_t ver_key;
char *ver_string;

nns_edge_get_version (&major1, &minor1, &micro1);
ver_key = nns_edge_generate_version_key ();
EXPECT_TRUE (nns_edge_parse_version_key (ver_key, &major2, &minor2, &micro2));
EXPECT_EQ (major1, major2);
EXPECT_EQ (minor1, minor2);
EXPECT_EQ (micro1, micro2);

ver_string = nns_edge_strdup_printf ("%u.%u.%u", major1, minor1, micro1);
EXPECT_STREQ (ver_string, VERSION);
nns_edge_free (ver_string);
}

/**
Expand Down
11 changes: 9 additions & 2 deletions tools/build_TizenRT/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs

# Set nnstreamer-edge version
VERSION = 0.2.5
VERSION_MAJOR = $(word 1,$(subst ., ,$(VERSION)))
VERSION_MINOR = $(word 2,$(subst ., ,$(VERSION)))
VERSION_MICRO = $(word 3,$(subst ., ,$(VERSION)))

ASRCS =
CSRCS = src/libnnstreamer-edge/nnstreamer-edge-data.c \
src/libnnstreamer-edge/nnstreamer-edge-event.c \
Expand All @@ -62,10 +68,11 @@ CSRCS = src/libnnstreamer-edge/nnstreamer-edge-data.c \
src/libnnstreamer-edge/nnstreamer-edge-queue.c \
src/libnnstreamer-edge/nnstreamer-edge-util.c

CFLAGS += -I ./include -DDEBUG=0
CFLAGS += -I./include -DDEBUG=0
CFLAGS += -DVERSION=\"$(VERSION)\" -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_MICRO=$(VERSION_MICRO)

ifeq ($(CONFIG_NETUTILS_MQTT),y)
CFLAGS += -I ../mosquitto
CFLAGS += -I../mosquitto -I../include/mosquitto
CFLAGS += -DENABLE_MQTT=1
CSRCS += src/libnnstreamer-edge/nnstreamer-edge-mqtt-mosquitto.c
endif
Expand Down

0 comments on commit e74b198

Please sign in to comment.