Skip to content

Commit

Permalink
Makefile: disable cJSON support when building without math support
Browse files Browse the repository at this point in the history
Signed-off-by: Thiago Macieira <[email protected]>
  • Loading branch information
thiagomacieira committed May 2, 2024
1 parent 64ce7ad commit 268a61e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
Expand Down
7 changes: 4 additions & 3 deletions Makefile.configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ PROGRAM-freestanding += int main() {}
CCFLAGS-freestanding = $(CFLAGS)

PROGRAM-cjson = \#include <stdlib.h>\n
PROGRAM-cjson += \#include <math.h>\n
PROGRAM-cjson += \#include <cjson/cJSON.h>\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.
Expand Down

0 comments on commit 268a61e

Please sign in to comment.