From 563cd97dcb060a2d4a0b5fe3b89a29ab0aa544e5 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Fri, 8 Jul 2022 17:53:41 +0200 Subject: [PATCH] Move GCC only flags to check --- libultraship/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libultraship/Makefile b/libultraship/Makefile index 3a91ee6765e..978fcee7f01 100644 --- a/libultraship/Makefile +++ b/libultraship/Makefile @@ -17,7 +17,6 @@ WARN := -Wall -Wextra -Werror \ -Wno-unused-function \ -Wno-parentheses \ -Wno-narrowing \ - -Wno-error=stringop-overflow \ -Wno-missing-field-initializers \ -Wno-error=multichar \ -Wno-unused-command-line-argument \ @@ -27,7 +26,14 @@ WARN := -Wall -Wextra -Werror \ -Wno-deprecated-declarations CWARN := -CXXWARN := -Wno-deprecated-enum-enum-conversion -Wno-error=maybe-uninitialized +CXXWARN := -Wno-deprecated-enum-enum-conversion + +# Detect if CXX is clang++ or g++, in this order. +COMPILER_VERSION := $(shell $(CXX) --version) +ifneq '' '$(findstring g++,$(COMPILER_VERSION))' + WARN += -Wno-error=stringop-overflow + CXXWARN += -Wno-error=maybe-uninitialized +endif CXXFLAGS := $(WARN) $(CXXWARN) -std=c++20 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0 CFLAGS := $(WARN) $(CWARN) -std=c99 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0