Optional build info compiled into turnserver binary (#1083)

Example usage with make:

make CPPFLAGS="-DTURN_SERVER_BUILD_INFO=\"\\\" git: $(git rev-parse
HEAD) build: 123\\\"\""

Example usage with cmake:

cmake .. -DTURN_SERVER_BUILD_INFO="\" git: $(git rev-parse HEAD) build:
123\""
This commit is contained in:
Erik Moqvist 2022-11-13 19:24:50 +01:00 committed by GitHub
parent bf5cfb516d
commit e55bbc0413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -52,6 +52,9 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type)
if("debug" STREQUAL build_type)
add_definitions(-D_DEBUG)
endif()
if(DEFINED TURN_SERVER_BUILD_INFO)
add_definitions(-DTURN_SERVER_BUILD_INFO=${TURN_SERVER_BUILD_INFO})
endif()
IF(MSVC)
# This option is to enable the /MP switch for Visual Studio 2005 and above compilers

View File

@ -33,7 +33,10 @@
#define TURN_SERVER_VERSION "4.6.0"
#define TURN_SERVER_VERSION_NAME "Gorst"
#define TURN_SOFTWARE "Coturn-" TURN_SERVER_VERSION " '" TURN_SERVER_VERSION_NAME "'"
#ifndef TURN_SERVER_BUILD_INFO
#define TURN_SERVER_BUILD_INFO ""
#endif
#define TURN_SOFTWARE "Coturn-" TURN_SERVER_VERSION " '" TURN_SERVER_VERSION_NAME "'" TURN_SERVER_BUILD_INFO
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>