1
0
Эх сурвалжийг харах

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\""
Erik Moqvist 3 жил өмнө
parent
commit
e55bbc0413
2 өөрчлөгдсөн 7 нэмэгдсэн , 1 устгасан
  1. 3 0
      CMakeLists.txt
  2. 4 1
      src/ns_turn_defs.h

+ 3 - 0
CMakeLists.txt

@@ -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

+ 4 - 1
src/ns_turn_defs.h

@@ -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>