Refactor version file generation

This commit is contained in:
Luke Benstead 2021-04-08 20:58:35 +01:00
parent 0493e0e008
commit 91f32a9fba
3 changed files with 14 additions and 0 deletions

View File

@ -30,8 +30,17 @@ set(
GL/texture.c
GL/util.c
GL/yalloc/yalloc.c
${CMAKE_CURRENT_BINARY_DIR}/version.c
)
execute_process(
COMMAND git describe --abbrev=4 --dirty --always --tags
OUTPUT_VARIABLE GLDC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
configure_file(GL/version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c)
if(PLATFORM_DREAMCAST)
set(SOURCES ${SOURCES} GL/platforms/sh4.c)
else()

2
GL/version.c.in Normal file
View File

@ -0,0 +1,2 @@
const char* GLDC_VERSION = "@GLDC_VERSION@";

View File

@ -4,6 +4,9 @@
__BEGIN_DECLS
extern const char* GLDC_VERSION;
/*
* Dreamcast specific compressed + twiddled formats.
* We use constants from the range 0xEEE0 onwards