mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-10 03:15:59 +03:00
feat(build): compile version strings from CMake
This commit is contained in:
parent
0ca9e90859
commit
03fc131e2e
@ -30,6 +30,18 @@ include(lib/system/cmake/system.cmake)
|
|||||||
|
|
||||||
# Build options
|
# Build options
|
||||||
|
|
||||||
|
set(WHOA_VERSION_BUILD 12340)
|
||||||
|
set(WHOA_VERSION_MAJOR 3)
|
||||||
|
set(WHOA_VERSION_MINOR 3)
|
||||||
|
set(WHOA_VERSION_PATCH 5)
|
||||||
|
set(WHOA_VERSION_HOTFIX a)
|
||||||
|
|
||||||
|
add_definitions(-DWHOA_VERSION_BUILD="${WHOA_VERSION_BUILD}")
|
||||||
|
add_definitions(-DWHOA_VERSION_MAJOR="${WHOA_VERSION_MAJOR}")
|
||||||
|
add_definitions(-DWHOA_VERSION_MINOR="${WHOA_VERSION_MINOR}")
|
||||||
|
add_definitions(-DWHOA_VERSION_PATCH="${WHOA_VERSION_PATCH}")
|
||||||
|
add_definitions(-DWHOA_VERSION_HOTFIX="${WHOA_VERSION_HOTFIX}")
|
||||||
|
|
||||||
# UBsan
|
# UBsan
|
||||||
set(WHOA_UB_SAN_HELP_TEXT "Disable/Enable the Undefined Behavior Sanitizer. This is turned on by default in Debug build types. Has no effect when using MSVC.")
|
set(WHOA_UB_SAN_HELP_TEXT "Disable/Enable the Undefined Behavior Sanitizer. This is turned on by default in Debug build types. Has no effect when using MSVC.")
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
|||||||
@ -1,7 +1,21 @@
|
|||||||
#include "console/Console.hpp"
|
#include "console/Console.hpp"
|
||||||
#include "console/command/Commands.hpp"
|
#include "console/command/Commands.hpp"
|
||||||
|
|
||||||
|
#if defined(NDEBUG)
|
||||||
|
#define WHOA_BUILD_TYPE "Release"
|
||||||
|
#else
|
||||||
|
#define WHOA_BUILD_TYPE "Debug"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define WHOA_BRAND_STRING "Whoa"
|
||||||
|
|
||||||
|
#define WHOA_PROJECT_URL "https://github.com/thunderbrewhq/thunderbrew"
|
||||||
|
|
||||||
|
#define WHOA_VERSION_STRING WHOA_BRAND_STRING " [" WHOA_BUILD_TYPE "] Build " WHOA_VERSION_BUILD " (" __DATE__ ") <" WHOA_PROJECT_URL ">"
|
||||||
|
|
||||||
DECLARE_COMMAND(Ver) {
|
DECLARE_COMMAND(Ver) {
|
||||||
ConsoleWrite("Whoa <https://github.com/whoahq/whoa>", DEFAULT_COLOR);
|
// ConsoleWrite("Thunderbrew <https://github.com/thunderbrewhq/thunderbrew>", ADMIN_COLOR);
|
||||||
|
ConsoleWrite(WHOA_VERSION_STRING, DEFAULT_COLOR);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user