Skip to content

Commit

Permalink
Automatically set NOFLAGS to 1 for C++ compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
HiGarfield committed Jan 21, 2025
1 parent c32e85c commit 759298c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ override CFLAGS += -Wunsafe-loop-optimizations
endif # $(CC) = gcc
endif # CHECK = 1

# Set NOFLAGS to 1 for C++ compilers
NOFLAGS := $(if $(findstring ++,$(CC)),1)

# If NOFLAGS is set to 1, set CFLAGS and LDFLAGS to empty
ifeq ($(NOFLAGS),1)
override CFLAGS :=
Expand Down
3 changes: 3 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ override CFLAGS += -Wunsafe-loop-optimizations
endif # $(CC) = gcc
endif # CHECK = 1

# Set NOFLAGS to 1 for C++ compilers
NOFLAGS := $(if $(findstring ++,$(CC)),1)

# If NOFLAGS is set to 1, set CFLAGS and LDFLAGS to empty
ifeq ($(NOFLAGS),1)
override CFLAGS :=
Expand Down

0 comments on commit 759298c

Please sign in to comment.