From 3b4a7c12fc30d912458842bfbb96936161395519 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sat, 25 Sep 2021 11:48:33 +0200 Subject: [PATCH] Changed: Only look for g++-11 if CXX=g++ --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index bcb94b0..0cca16b 100644 --- a/Makefile +++ b/Makefile @@ -39,12 +39,14 @@ CXX ?= g++ override CXX_VERSION := $(shell $(CXX) -dumpfullversion -dumpversion || echo 0) #? Try to make sure we are using GCC/G++ version 11 or later if not instructed to use g++-10 -ifneq ($(CXX),g++-10) - V_MAJOR := $(shell echo $(CXX_VERSION) | cut -f1 -d".") - ifneq ($(shell test $(V_MAJOR) -ge 11; echo $$?),0) - ifeq ($(shell command -v g++-11 >/dev/null; echo $$?),0) - override CXX := g++-11 - override CXX_VERSION := $(shell $(CXX) -dumpfullversion -dumpversion || echo 0) +ifeq ($(CXX),g++) + ifneq ($(CXX),g++-10) + V_MAJOR := $(shell echo $(CXX_VERSION) | cut -f1 -d".") + ifneq ($(shell test $(V_MAJOR) -ge 11; echo $$?),0) + ifeq ($(shell command -v g++-11 >/dev/null; echo $$?),0) + override CXX := g++-11 + override CXX_VERSION := $(shell $(CXX) -dumpfullversion -dumpversion || echo 0) + endif endif endif endif