mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-12-26 18:19:53 +03:00
CMake: set build info as compiler macros
This commit is contained in:
parent
c21f427fc6
commit
9d601c2745
@ -18,3 +18,36 @@ target_link_libraries(cedar ${LIB_READLINE} ${CURSES_LIBRARIES})
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
target_link_libraries(cedar pcap)
|
||||
endif()
|
||||
|
||||
# Version
|
||||
add_definitions(-DCEDAR_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} -DCEDAR_VERSION_MINOR=${PROJECT_VERSION_MINOR} -DCEDAR_VERSION_BUILD=${PROJECT_VERSION_PATCH})
|
||||
|
||||
# Builder
|
||||
if(UNIX)
|
||||
add_definitions(-DBUILDER_NAME="$ENV{USER}")
|
||||
elseif(WIN32)
|
||||
add_definitions(-DBUILDER_NAME="$ENV{USERNAME}")
|
||||
endif()
|
||||
|
||||
cmake_host_system_information(RESULT BUILDER_HOSTNAME QUERY HOSTNAME)
|
||||
|
||||
add_definitions(-DBUILD_PLACE="${BUILDER_HOSTNAME}")
|
||||
|
||||
# Date and time
|
||||
string(TIMESTAMP BUILD_DAY "%d" UTC)
|
||||
string(TIMESTAMP BUILD_MONTH "%m" UTC)
|
||||
string(TIMESTAMP BUILD_YEAR "%Y" UTC)
|
||||
string(TIMESTAMP BUILD_HOUR "%H" UTC)
|
||||
string(TIMESTAMP BUILD_MINUTE "%M" UTC)
|
||||
string(TIMESTAMP BUILD_SECOND "%S" UTC)
|
||||
|
||||
## Remove leading 0
|
||||
string(REGEX REPLACE "^0" "" BUILD_DAY "${BUILD_DAY}")
|
||||
string(REGEX REPLACE "^0" "" BUILD_MONTH "${BUILD_MONTH}")
|
||||
string(REGEX REPLACE "^0" "" BUILD_YEAR "${BUILD_YEAR}")
|
||||
string(REGEX REPLACE "^0" "" BUILD_HOUR "${BUILD_HOUR}")
|
||||
string(REGEX REPLACE "^0" "" BUILD_MINUTE "${BUILD_MINUTE}")
|
||||
string(REGEX REPLACE "^0" "" BUILD_SECOND "${BUILD_SECOND}")
|
||||
|
||||
add_definitions(-DBUILD_DATE_D=${BUILD_DAY} -DBUILD_DATE_M=${BUILD_MONTH} -DBUILD_DATE_Y=${BUILD_YEAR})
|
||||
add_definitions(-DBUILD_DATE_HO=${BUILD_HOUR} -DBUILD_DATE_MI=${BUILD_MINUTE} -DBUILD_DATE_SE=${BUILD_SECOND})
|
||||
|
@ -135,18 +135,18 @@
|
||||
|
||||
|
||||
// Version number
|
||||
#ifndef CEDAR_VERSION_MAJOR
|
||||
#define CEDAR_VERSION_MAJOR 0
|
||||
#endif // CEDAR_VERSION_MAJOR
|
||||
#ifndef CEDAR_VERSION_MAJOR
|
||||
#define CEDAR_VERSION_MAJOR 0
|
||||
#endif // CEDAR_VERSION_MAJOR
|
||||
|
||||
#ifndef CEDAR_VERSION_MINOR
|
||||
#define CEDAR_VERSION_MINOR 0
|
||||
#endif // CEDAR_VER_MINOR
|
||||
#ifndef CEDAR_VERSION_MINOR
|
||||
#define CEDAR_VERSION_MINOR 0
|
||||
#endif // CEDAR_VER_MINOR
|
||||
|
||||
// Build Number
|
||||
#ifndef CEDAR_VERSION_BUILD
|
||||
#define CEDAR_VERSION_BUILD 0
|
||||
#endif // CEDAR_VERSION_BUILD
|
||||
// Build number
|
||||
#ifndef CEDAR_VERSION_BUILD
|
||||
#define CEDAR_VERSION_BUILD 0
|
||||
#endif // CEDAR_VERSION_BUILD
|
||||
|
||||
// Beta number
|
||||
//#define BETA_NUMBER 3
|
||||
@ -156,38 +156,38 @@
|
||||
|
||||
// Specify the name of the person in charge building
|
||||
#ifndef BUILDER_NAME
|
||||
#define BUILDER_NAME "Unknown"
|
||||
#define BUILDER_NAME "Unknown"
|
||||
#endif // BUILDER_NAME
|
||||
|
||||
// Specify the location to build
|
||||
#ifndef BUILD_PLACE
|
||||
#define BUILD_PLACE "Unknown"
|
||||
#define BUILD_PLACE "Unknown"
|
||||
#endif // BUILD_PLACE
|
||||
|
||||
// Specifies the build date
|
||||
#ifndef BUILD_DATE_Y
|
||||
#define BUILD_DATE_Y 1970
|
||||
#endif // BUILD_DATE_Y
|
||||
#ifndef BUILD_DATE_Y
|
||||
#define BUILD_DATE_Y 1970
|
||||
#endif // BUILD_DATE_Y
|
||||
|
||||
#ifndef BUILD_DATE_M
|
||||
#define BUILD_DATE_M 1
|
||||
#endif // BUILD_DATE_M
|
||||
#ifndef BUILD_DATE_M
|
||||
#define BUILD_DATE_M 1
|
||||
#endif // BUILD_DATE_M
|
||||
|
||||
#ifndef BUILD_DATE_D
|
||||
#define BUILD_DATE_D 1
|
||||
#endif // BUILD_DATE_D
|
||||
#ifndef BUILD_DATE_D
|
||||
#define BUILD_DATE_D 1
|
||||
#endif // BUILD_DATE_D
|
||||
|
||||
#ifndef BUILD_DATE_HO
|
||||
#define BUILD_DATE_HO 0
|
||||
#endif // BUILD_DATE_HO
|
||||
#ifndef BUILD_DATE_HO
|
||||
#define BUILD_DATE_HO 0
|
||||
#endif // BUILD_DATE_HO
|
||||
|
||||
#ifndef BUILD_DATE_MI
|
||||
#define BUILD_DATE_MI 0
|
||||
#endif // BUILD_DATE_MI
|
||||
#ifndef BUILD_DATE_MI
|
||||
#define BUILD_DATE_MI 0
|
||||
#endif // BUILD_DATE_MI
|
||||
|
||||
#ifndef BUILD_DATE_SE
|
||||
#define BUILD_DATE_SE 0
|
||||
#endif // BUILD_DATE_SE
|
||||
#ifndef BUILD_DATE_SE
|
||||
#define BUILD_DATE_SE 0
|
||||
#endif // BUILD_DATE_SE
|
||||
|
||||
// Tolerable time difference
|
||||
#define ALLOW_TIMESTAMP_DIFF (UINT64)(3 * 24 * 60 * 60 * 1000)
|
||||
|
Loading…
Reference in New Issue
Block a user