cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 4703f01cf411bd3e3f97c2487deac8a1ef92ac8d
parent d0a9f468889d7d45270a7902974ab6c5b8144cd1
Author: Max Bruckner <max@maxbruckner.de>
Date:   Sat, 26 Nov 2016 12:57:12 +0700

Make/CMake: Fix use of compiler flags

CMake: Option was not enabled by default as intended.
Makefile: Flags were not passed when building the tests

Diffstat:
MCMakeLists.txt | 2+-
MMakefile | 6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -12,7 +12,7 @@ set(CJSON_VERSION_SO 1) set(CJSON_UTILS_VERSION_SO 1) set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") -option(ENABLE_CUSTOM_COMPILER_FLAGS ON) +option(ENABLE_CUSTOM_COMPILER_FLAGS "Enables custom compiler flags for Clang and GCC" ON) if (ENABLE_CUSTOM_COMPILER_FLAGS) if(("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -pedantic -Wall -Wextra -Werror -Wstrict-prototypes -Wwrite-strings") diff --git a/Makefile b/Makefile @@ -62,15 +62,15 @@ test: tests ./$(UTILS_TEST) .c.o: - $(CC) -ansi -pedantic -c $(R_CFLAGS) $< + $(CC) -c $(R_CFLAGS) $< #tests #cJSON $(CJSON_TEST): cJSON.c cJSON.h test.c - $(CC) $^ -o $@ $(LDLIBS) -I. + $(CC) $(R_CFLAGS) $^ -o $@ $(LDLIBS) -I. #cJSON_Utils $(UTILS_TEST): cJSON.c cJSON.h test.c - $(CC) $^ -o $@ $(LDLIBS) -I. + $(CC) $(R_CFLAGS) $^ -o $@ $(LDLIBS) -I. #static libraries #cJSON