From: Jaeyun Jung Date: Thu, 7 Dec 2023 12:06:20 +0000 (+0900) Subject: [Build] nns-edge version info X-Git-Tag: accepted/tizen/unified/20240105.012957^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7fd23851b249ad0f07bfe936559860651b51c88c;p=platform%2Fupstream%2Fnnstreamer-edge.git [Build] nns-edge version info Update build script to set version info. Signed-off-by: Jaeyun Jung --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 632f7f4..762b4af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/packaging/nnstreamer-edge.spec b/packaging/nnstreamer-edge.spec index 890df83..04630f6 100644 --- a/packaging/nnstreamer-edge.spec +++ b/packaging/nnstreamer-edge.spec @@ -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 diff --git a/tests/unittest_nnstreamer-edge.cc b/tests/unittest_nnstreamer-edge.cc index 6c2a315..799078a 100644 --- a/tests/unittest_nnstreamer-edge.cc +++ b/tests/unittest_nnstreamer-edge.cc @@ -3797,6 +3797,7 @@ 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, µ1); ver_key = nns_edge_generate_version_key (); @@ -3804,6 +3805,10 @@ TEST(edgeUtil, getVersion) 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); } /** diff --git a/tools/build_TizenRT/Makefile b/tools/build_TizenRT/Makefile index 0df85fe..c2e2108 100644 --- a/tools/build_TizenRT/Makefile +++ b/tools/build_TizenRT/Makefile @@ -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 \ @@ -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