From 647c846f9f631da8854ee65688561a482e85fc34 Mon Sep 17 00:00:00 2001 From: nah <2trill2spill@gmail.com> Date: Sun, 4 Sep 2016 09:25:44 -0500 Subject: [PATCH] Set CFLAGS differently for linux and osx. Add check for linux and move initial CFLAG settings inside linux check. Add CFLAGS specific to osx and clang to the existing osx/darwin check. Ignore clang warning about default on covered enum switch, look at pull #217 and pull #177 for more info about why that warning is ignored on clang. Ignore unknown clang options so that I don't have to change CFLAG settings elsewhere in the file, clang should just ignore options it dosen't know about. --- test/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Makefile b/test/Makefile index f5a167b..d10f28f 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,9 +1,13 @@ CC = gcc ifeq ($(shell uname -s), Darwin) CC = clang +CFLAGS += -std=c99 -pedantic -Wall -Weverything -Werror +CFLAGS += -Wno-unknown-warning-option -Wno-switch-enum +endif +ifeq ($(shell uname -s), Linux) +CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror endif #DEBUG = -O0 -g -CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror CFLAGS += $(DEBUG) DEFINES = -D UNITY_OUTPUT_CHAR=putcharSpy DEFINES += -D UNITY_SUPPORT_64 -D UNITY_INCLUDE_DOUBLE -D UNITY_NO_WEAK