[Build] nns-edge version info accepted/tizen_unified_riscv accepted/tizen/unified/20240105.012957 accepted/tizen/unified/20240119.154759 accepted/tizen/unified/riscv/20240105.060117
authorJaeyun Jung <jy1210.jung@samsung.com>
Thu, 7 Dec 2023 12:06:20 +0000 (21:06 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Fri, 22 Dec 2023 05:43:52 +0000 (14:43 +0900)
Update build script to set version info.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
CMakeLists.txt
packaging/nnstreamer-edge.spec
tests/unittest_nnstreamer-edge.cc
tools/build_TizenRT/Makefile

index 632f7f4d0898e15bf8ad1ffb67f776f690a6fd1d..762b4afa127717e7dd6cd8e8ae5e94804e01022f 100644 (file)
@@ -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")
index 890df83dad2e38489a96c3c9ae97d1d67d2558b9..04630f659f947ccde9d92a2682ef487ca0a573c6 100644 (file)
@@ -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
index 6c2a31507c5dffbd83a562fbdf4efda8283923de..799078a741118cf25a5f522269bf85480ed5614b 100644 (file)
@@ -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, &micro1);
   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);
 }
 
 /**
index 0df85fee5b4cfbd8159046f937071495588bb06d..c2e2108f4b8be05b4ccf8e8b52ed43fa7cc1d36e 100644 (file)
 -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