Makefile: disable cJSON support when building without math support

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Thiago Macieira
2024-05-01 18:35:40 -07:00
parent 64ce7adff0
commit 268a61ed17
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
{ "name": "gcc-no-math", { "name": "gcc-no-math",
"flags": "flags":
'{ "QMAKESPEC": "linux-gcc-no-math", '{ "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", "CFLAGS": "-ffreestanding -DCBOR_NO_FLOATING_POINT -Os",
"LDFLAGS": "-Wl,--no-undefined", "LDFLAGS": "-Wl,--no-undefined",
"LDLIBS": "" "LDLIBS": ""
+4 -3
View File
@@ -15,11 +15,12 @@ PROGRAM-freestanding += int main() {}
CCFLAGS-freestanding = $(CFLAGS) CCFLAGS-freestanding = $(CFLAGS)
PROGRAM-cjson = \#include <stdlib.h>\n PROGRAM-cjson = \#include <stdlib.h>\n
PROGRAM-cjson += \#include <math.h>\n
PROGRAM-cjson += \#include <cjson/cJSON.h>\n PROGRAM-cjson += \#include <cjson/cJSON.h>\n
PROGRAM-cjson += int main() { return cJSON_False; } PROGRAM-cjson += int main() { double d = NAN; return cJSON_False; }
CCFLAGS-cjson = -I$(dir $(MAKEFILE))src CCFLAGS-cjson = -I. -I$(dir $(MAKEFILE))src
PROGRAM-system-cjson = $(PROGRAM-cjson) PROGRAM-system-cjson = $(PROGRAM-cjson)
CCFLAGS-system-cjson = -lcjson CCFLAGS-system-cjson = -I. -lcjson
sink: sink:
@echo >&2 Please run from the top-level Makefile. @echo >&2 Please run from the top-level Makefile.