Skip to content

Commit 07b192b

Browse files
intelmarktianjunwork
authored andcommitted
Refactor versioning
Made changes to create EvApiVersion.h automatically during make process (similar to HEVC versioning) Also updated .gitignore to ignore Windows build files Signed-off-by: Mark Feldman <mark.feldman@intel.com>
1 parent afcbd87 commit 07b192b

File tree

5 files changed

+37
-12
lines changed

5 files changed

+37
-12
lines changed

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
*.ivf
1515
*.exe
1616
*.bat
17-
Build/VS17/x64
1817
Bin
19-
Build/linux/debug/
20-
Build/linux/release/
21-
22-
18+
Build
19+
!Build/linux/build.sh
20+
!Build/windows/generate_vs17.bat

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
3939

4040
set(SVT_VP9_VERSION_MAJOR "0")
4141
set(SVT_VP9_VERSION_MINOR "1")
42-
set(SVT_VP9_VERSION_PATCHLEVEL "0")
42+
set(SVT_VP9_VERSION_PATCHLEVEL "1")
43+
44+
configure_file(${PROJECT_SOURCE_DIR}/Source/API/EbApiVersion.h.in ${PROJECT_SOURCE_DIR}/Source/API/EbApiVersion.h @ONLY)
45+
4346
if(NOT DEFINED SVT_VP9_VERSION OR SVT_VP9_VERSION STREQUAL "")
4447
set(
4548
SVT_VP9_VERSION

Source/API/EbApiVersion.h.in

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright(c) 2018 Intel Corporation
3+
* SPDX - License - Identifier: BSD - 2 - Clause - Patent
4+
*/
5+
6+
#ifndef EbApiVersion_h
7+
#define EbApiVersion_h
8+
9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif // __cplusplus
12+
13+
// API Version
14+
#define SVT_VERSION_MAJOR (@SVT_VP9_VERSION_MAJOR@)
15+
#define SVT_VERSION_MINOR (@SVT_VP9_VERSION_MINOR@)
16+
#define SVT_VERSION_PATCHLEVEL (@SVT_VP9_VERSION_PATCHLEVEL@)
17+
18+
#define SVT_CHECK_VERSION(major,minor,patch) \
19+
(SVT_VERSION_MAJOR > (major) || \
20+
(SVT_VERSION_MAJOR == (major) && SVT_VERSION_MINOR > (minor)) || \
21+
(SVT_VERSION_MAJOR == (major) && SVT_VERSION_MINOR == (minor) && \
22+
SVT_VERSION_PATCHLEVEL >= (patch)))
23+
24+
#ifdef __cplusplus
25+
}
26+
#endif // __cplusplus
27+
28+
#endif // EbApiVersion_h

Source/API/EbSvtVp9Enc.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define EbSvtVp9Enc_h
88

99
#include <stdint.h>
10-
10+
#include <EbApiVersion.h>
1111

1212
#ifdef __cplusplus
1313
extern "C" {
@@ -26,10 +26,6 @@ extern "C" {
2626
#define EB_ENCODERRECONPORT 2
2727
#define EB_ENCODERSTATISTICSPORT 3
2828

29-
#define SVT_VERSION_MAJOR 0
30-
#define SVT_VERSION_MINOR 1
31-
#define SVT_VERSION_PATCHLEVEL 0
32-
3329
#define EbBool uint8_t
3430
#define EB_FALSE 0
3531
#define EB_TRUE 1

Source/Lib/pkg-config.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
44

55
Name: SvtVp9Enc
66
Description: SVT (Scalable Video Technology) for VP9 encoder library
7-
Version: @SVT_VP9_VERSION@
7+
Version: @SVT_VP9_VERSION_MAJOR@.@SVT_VP9_VERSION_MINOR@.@SVT_VP9_VERSION_PATCHLEVEL@
88
Libs: -L${libdir} -lSvtVp9Enc @LIBS@
99
Cflags: -I${includedir}

0 commit comments

Comments
 (0)