Skip to content

Commit

Permalink
apply clang version check to tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Nov 29, 2023
1 parent 194f9b0 commit 059d21f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ INCLUDE_DIR := include/$(LIB_SHORT_NAME)
COV_DIR := coverage
PREFIX := $(PWD)
BREW_PREFIX := $(shell /usr/bin/env -P /usr/local/bin:/opt/homebrew/bin brew --prefix)

COMPILER_VERSION := $(shell $(CXX) --version | grep version | grep -o -m 1 "[0-9]\+\.[0-9]\+\.*[0-9]*" | head -n 1)
COMPILER_VERSION_NUMBER := $(shell echo $(COMPILER_VERSION) | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/')
CLANG_13_OR_MORE := $(shell expr $(COMPILER_VERSION_NUMBER) \>= 130000)
ifneq ($(CLANG_13_OR_MORE),0)
CXXFLAGS := --std=c++20
# supported: c++11, c++14, c++17, c++20
# future: c++2b
else
CXXFLAGS := --std=c++17
endif

LDFLAGS :=
DYLIB := $(LIB_DIR)/lib$(LIB_SHORT_NAME).dylib

Expand Down

0 comments on commit 059d21f

Please sign in to comment.