From f3ba703444278a30c8cec495e2ff7cf7691fb553 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sat, 31 Aug 2024 14:09:35 +0200 Subject: [PATCH] add git commit hash to mingw build as well --- Makefile | 2 ++ build.cmd | 2 +- res.rc | 6 ------ src/debug.c | 9 +-------- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 7a238b2..626761a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ -include config.mk TARGET = ddraw.dll +GIT_REV := $(shell git rev-parse --short @{0} || echo "UNKNOWN") +GIT_FILE := $(shell echo "#define GIT_COMMIT" $(GIT_REV) > inc/version_tmp.h) LDFLAGS = -Wl,--enable-stdcall-fixup -s -static -shared CFLAGS = -Iinc -O2 -march=i486 -Wall LIBS = -lgdi32 -lwinmm -ldbghelp -lole32 diff --git a/build.cmd b/build.cmd index c9d3564..7613fd2 100644 --- a/build.cmd +++ b/build.cmd @@ -2,7 +2,7 @@ REM REM patch environment config REM -set PATH=C:\w64devkit\bin +set PATH=C:\w64devkit\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw64\bin\ make clean make REM make DEBUG=1 diff --git a/res.rc b/res.rc index 9c361ce..9bf5f3d 100644 --- a/res.rc +++ b/res.rc @@ -1,12 +1,6 @@ #include "inc/version.h" - -#ifndef __GNUC__ #include "inc/version_tmp.h" -#endif -#ifndef GIT_COMMIT -#define GIT_COMMIT UNKNOWN -#endif 1 VERSIONINFO FILEVERSION VERSION diff --git a/src/debug.c b/src/debug.c index b21bf11..27304cb 100644 --- a/src/debug.c +++ b/src/debug.c @@ -8,15 +8,8 @@ #include "debug.h" #include "hook.h" #include "version.h" -#include "versionhelpers.h" - -#ifndef __GNUC__ #include "version_tmp.h" -#endif - -#ifndef GIT_COMMIT -#define GIT_COMMIT UNKNOWN -#endif +#include "versionhelpers.h" double g_dbg_frame_time = 0;