Make Git hash only dev or debug

This commit is contained in:
Agent X 2025-03-31 19:30:43 -04:00
parent af15844a69
commit 60e81e2bd2

View file

@ -334,15 +334,6 @@ OPT_FLAGS += $(BITS)
TARGET := sm64.$(VERSION)
# Stuff for showing the git hash and build time in dev builds
# Originally from https://stackoverflow.com/questions/44038428/include-git-commit-hash-and-or-branch-name-in-c-c-source
ifneq ($(shell git rev-parse --abbrev-ref HEAD),main)
GIT_HASH=$(shell git rev-parse --short HEAD)
COMPILE_TIME=$(shell date -u +'%Y-%m-%d %H:%M:%S UTC')
C_DEFINES += -DGIT_HASH="\"$(GIT_HASH)\"" -DCOMPILE_TIME="\"$(COMPILE_TIME)\""
endif
# GRUCODE - selects which RSP microcode to use.
# f3d_old - default for JP and US versions
# f3d_new - default for EU and Shindou versions
@ -1024,6 +1015,12 @@ ifeq ($(IS_DEV_OR_DEBUG),0)
ifeq ($(OSX_BUILD),0)
LDFLAGS += -Wl,--build-id=none
endif
# Stuff for showing the git hash and build time in dev builds
# Originally from https://stackoverflow.com/questions/44038428/include-git-commit-hash-and-or-branch-name-in-c-c-source
GIT_HASH=$(shell git rev-parse --short HEAD)
COMPILE_TIME=$(shell date -u +'%Y-%m-%d %H:%M:%S UTC')
C_DEFINES += -DGIT_HASH="\"$(GIT_HASH)\"" -DCOMPILE_TIME="\"$(COMPILE_TIME)\""
endif
# Enable ASLR