Skip to content

Commit 9175e26

Browse files
committed
Add version macros
Add version.h with the following values. This values are managed/updated via CMake ``` #pragma once #define RTC_VERSION_MAJOR 0 #define RTC_VERSION_MINOR 20 #define RTC_VERSION_PATCH 1 #define RTC_VERSION "0.20.1" ``` # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Fri Feb 16 10:25:47 2024 -0500 # # On branch version-macro # Changes to be committed: # modified: CMakeLists.txt # new file: cmake/version.h.in # modified: include/rtc/rtc.h # new file: include/rtc/version.h # # Untracked files: # install/ #
1 parent e87cbee commit 9175e26

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ set(LIBDATACHANNEL_HEADERS
118118
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/rtcpnackresponder.hpp
119119
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/utils.hpp
120120
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/plihandler.hpp
121+
${PROJECT_BINARY_DIR}/include/rtc/version.h
121122
)
122123

123124
set(LIBDATACHANNEL_IMPL_SOURCES
@@ -252,6 +253,11 @@ else()
252253
add_library(Usrsctp::Usrsctp ALIAS usrsctp)
253254
endif()
254255

256+
configure_file (
257+
${PROJECT_SOURCE_DIR}/cmake/version.h.in
258+
${CMAKE_INSTALL_INCLUDEDIR}/rtc/version.h
259+
)
260+
255261
add_library(datachannel SHARED
256262
${LIBDATACHANNEL_SOURCES}
257263
${LIBDATACHANNEL_HEADERS}

cmake/version.h.in

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
3+
#define RTC_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
4+
#define RTC_VERSION_MINOR @PROJECT_VERSION_MINOR@
5+
#define RTC_VERSION_PATCH @PROJECT_VERSION_PATCH@
6+
#define RTC_VERSION "@PROJECT_VERSION@"

include/rtc/rtc.h

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef RTC_C_API
1010
#define RTC_C_API
1111

12+
#include "version.h"
13+
1214
#ifdef __cplusplus
1315
extern "C" {
1416
#endif

include/rtc/version.h

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)