Skip to content

Commit

Permalink
Add logic to autodetect compiler and fix build with clang on linux
Browse files Browse the repository at this point in the history
Signed-off-by: Violet Purcell <[email protected]>
  • Loading branch information
vimproved committed Oct 15, 2023
1 parent f8c9b8b commit 809da01
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions source/Makefile.deps.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ endif # BSD
# ---------------------------------------------------------------------------------------------------------------------
# Auto-detect the processor

COMPILER_VERSION := $(shell $(CC) --version)

ifneq (,$(findstring clang,$(COMPILER_VERSION)))
CLANG = true
endif
ifneq (,$(findstring gcc,$(COMPILER_VERSION)))
GCC = true
endif

# ---------------------------------------------------------------------------------------------------------------------
# Auto-detect the processor

TARGET_PROCESSOR := $(firstword $(subst -, ,$(TARGET_MACHINE)))

ifneq (,$(filter i%86,$(TARGET_PROCESSOR)))
Expand Down
2 changes: 1 addition & 1 deletion source/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ CXXFLAGS += -fvisibility-inlines-hidden
endif

ifneq ($(MACOS_OR_WASM_OR_WINDOWS),true)
ifneq ($(BSD),true)
ifeq ($(GCC),true)
BASE_FLAGS += -fno-gnu-unique
endif
endif
Expand Down

0 comments on commit 809da01

Please sign in to comment.