From afe35b6b61b63f3381730d00b808baf1085ce0ba Mon Sep 17 00:00:00 2001 From: Ignacio Sanchez Gines <863613+drhelius@users.noreply.github.com> Date: Sun, 5 Jan 2025 12:23:26 +0100 Subject: [PATCH] Update makefile whith NDEBUG, sanitize address and better git version --- platforms/desktop-shared/Makefile.common | 14 +++++++------- platforms/libretro/Makefile | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/platforms/desktop-shared/Makefile.common b/platforms/desktop-shared/Makefile.common index e76f921..ff24088 100644 --- a/platforms/desktop-shared/Makefile.common +++ b/platforms/desktop-shared/Makefile.common @@ -1,9 +1,9 @@ define HEADER ____ _ / ___| ___ __ _ _ __ ___ ___ | | ___ ___ ___ - | | _ / _ \\/ _` | '__/ __/ _ \\| |/ _ \\/ __/ _ \\ + | | _ / _ \/ _` | '__/ __/ _ \| |/ _ \/ __/ _ \ | |_| | __/ (_| | | | (_| (_) | | __/ (_| (_) | - \\____|\\___|\\__,_|_| \\___\\___/|_|\\___|\\___\\___/ + \____|\___|\__,_|_| \___\___/|_|\___|\___\___/ ** Building for $(PLATFORM) platform ** ** Git version: $(GIT_VERSION) ** @@ -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" @@ -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) diff --git a/platforms/libretro/Makefile b/platforms/libretro/Makefile index cc86247..b1a4545 100644 --- a/platforms/libretro/Makefile +++ b/platforms/libretro/Makefile @@ -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