Skip to content

Commit

Permalink
makefile: don't add optimization flag if already set
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni500github committed Sep 4, 2024
1 parent 59cb489 commit 865c734
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ ifeq ($(DEBUG), 1)
BUILDDIR = build/debug
CXXFLAGS := -ggdb3 -Wall -Wextra -Wpedantic -DDEBUG=1 $(DEBUG_CXXFLAGS) $(CXXFLAGS)
else
CXXFLAGS := -O3 $(CXXFLAGS)
# Check if an optimization flag is not already set
ifneq ($(filter -O%,$(CXXFLAGS)),)
$(info Keeping the existing optimization flag in CXXFLAGS)
else
CXXFLAGS := -O3 $(CXXFLAGS)
endif
BUILDDIR = build/release
endif

Expand Down

0 comments on commit 865c734

Please sign in to comment.