Skip to content

Commit

Permalink
Update makefile whith NDEBUG, sanitize address and better git version
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jan 5, 2025
1 parent 4c64cbb commit afe35b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions platforms/desktop-shared/Makefile.common
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
define HEADER
____ _
/ ___| ___ __ _ _ __ ___ ___ | | ___ ___ ___
| | _ / _ \\/ _` | '__/ __/ _ \\| |/ _ \\/ __/ _ \\
| | _ / _ \/ _` | '__/ __/ _ \| |/ _ \/ __/ _ \
| |_| | __/ (_| | | | (_| (_) | | __/ (_| (_) |
\\____|\\___|\\__,_|_| \\___\\___/|_|\\___|\\___\\___/
\____|\___|\__,_|_| \___\___/|_|\___|\___\___/

** Building for $(PLATFORM) platform **
** Git version: $(GIT_VERSION) **
Expand All @@ -12,7 +12,7 @@ endef
export HEADER

TARGET_NAME = gearcoleco
GIT_VERSION := "$(shell git describe --abbrev=7 --dirty --always --tags)"
GIT_VERSION := $(shell git describe --abbrev=7 --dirty --always --tags)
UNAME_S := $(shell uname -s)
PLATFORM = "undefined"

Expand All @@ -35,17 +35,17 @@ CFLAGS += -std=c99
DEBUG ?= 0
ifeq ($(DEBUG), 1)
BUILD_CONFIG = Debug
CPPFLAGS +=-DDEBUG -g3
CPPFLAGS += -DDEBUG -g3
else
BUILD_CONFIG = Release
CPPFLAGS +=-DNDEBUG -O3 -flto=auto
CPPFLAGS += -DNDEBUG -O3 -flto=auto
LDFLAGS += -O3 -flto=auto
endif

SANITIZE ?= 0
ifeq ($(SANITIZE), 1)
CPPFLAGS +=-fsanitize=address
LDFLAGS += -lasan
CPPFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
endif

ifeq ($(UNAME_S), Linux)
Expand Down
6 changes: 3 additions & 3 deletions platforms/libretro/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,11 @@ ifeq ($(DEBUG), 1)
CXXFLAGS += -O0 -DDEBUG -g
else
BUILD_CONFIG = Release
CXXFLAGS += -O3
CXXFLAGS += -O3 -DNDEBUG
endif

GIT_VERSION ?= "$(shell git describe --abbrev=7 --dirty --always --tags || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
GIT_VERSION ?= $(shell git describe --abbrev=7 --dirty --always --tags || echo unknown)
ifneq ($(GIT_VERSION), unknown)
CXXFLAGS += -DEMULATOR_BUILD=\"$(GIT_VERSION)\"
endif

Expand Down

0 comments on commit afe35b6

Please sign in to comment.