Skip to content

Commit

Permalink
add software version
Browse files Browse the repository at this point in the history
  • Loading branch information
Cactusas committed Jun 12, 2022
1 parent bc5e5c8 commit b403994
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,16 @@ project(tunproxy C)
include_directories("src")
set(CMAKE_C_STANDARD 99)

set(SOFTWARE_MAJOR "1")
set(SOFTWARE_MINOR "0")
set(SOFTWARE_BUILD "0")
add_definitions(
-DSOFTWARE_MAJOR=${SOFTWARE_MAJOR}
-DSOFTWARE_MINOR=${SOFTWARE_MINOR}
-DSOFTWARE_BUILD=${SOFTWARE_BUILD}
)

add_definitions(-Wall)

file(GLOB_RECURSE SRC_FILES "src/*.c" "src/*.h")
add_executable(tunproxy ${SRC_FILES})
4 changes: 4 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,8 @@ void print_banner() {
printf("| |_| |_| | | | | |_) | | | (_) > <| |_| |\n");
printf(" \\__|\\__,_|_| |_| .__/|_| \\___/_/\\_\\\\__, |\n");
printf(" |_| |___/ \n");

#if defined(SOFTWARE_MAJOR) && defined(SOFTWARE_MINOR) && defined(SOFTWARE_BUILD)
printf("v%d.%d.%d\n\n", SOFTWARE_MAJOR, SOFTWARE_MINOR, SOFTWARE_BUILD);
#endif
}

0 comments on commit b403994

Please sign in to comment.