From 268a61ed17af0f36e264863c95dc5ba915d14521 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 1 May 2024 16:50:32 -0700 Subject: [PATCH] Makefile: disable cJSON support when building without math support Signed-off-by: Thiago Macieira --- .github/workflows/build.yml | 2 +- Makefile.configure | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3858ac3..a6f32ee6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: { "name": "gcc-no-math", "flags": '{ "QMAKESPEC": "linux-gcc-no-math", - "EVAL": "export CXX=false && touch src/math.h src/float.h", + "EVAL": "export CXX=false && touch math.h float.h", "CFLAGS": "-ffreestanding -DCBOR_NO_FLOATING_POINT -Os", "LDFLAGS": "-Wl,--no-undefined", "LDLIBS": "" diff --git a/Makefile.configure b/Makefile.configure index 16bab6bb..d906ef1b 100644 --- a/Makefile.configure +++ b/Makefile.configure @@ -15,11 +15,12 @@ PROGRAM-freestanding += int main() {} CCFLAGS-freestanding = $(CFLAGS) PROGRAM-cjson = \#include \n +PROGRAM-cjson += \#include \n PROGRAM-cjson += \#include \n -PROGRAM-cjson += int main() { return cJSON_False; } -CCFLAGS-cjson = -I$(dir $(MAKEFILE))src +PROGRAM-cjson += int main() { double d = NAN; return cJSON_False; } +CCFLAGS-cjson = -I. -I$(dir $(MAKEFILE))src PROGRAM-system-cjson = $(PROGRAM-cjson) -CCFLAGS-system-cjson = -lcjson +CCFLAGS-system-cjson = -I. -lcjson sink: @echo >&2 Please run from the top-level Makefile.