Skip to content

Commit 5d167a0

Browse files
thiagomacieirasjlongland
authored andcommitted
Makefile: disable cJSON support when building without math support
Signed-off-by: Thiago Macieira <[email protected]>
1 parent a38a520 commit 5d167a0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
{ "name": "gcc-no-math",
3131
"flags":
3232
'{ "QMAKESPEC": "linux-gcc-no-math",
33-
"EVAL": "export CXX=false && touch src/math.h src/float.h",
33+
"EVAL": "export CXX=false && touch math.h float.h",
3434
"CFLAGS": "-ffreestanding -DCBOR_NO_FLOATING_POINT -Os",
3535
"LDFLAGS": "-Wl,--no-undefined",
3636
"LDLIBS": ""

Makefile.configure

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ PROGRAM-freestanding += int main() {}
1515
CCFLAGS-freestanding = $(CFLAGS)
1616

1717
PROGRAM-cjson = \#include <stdlib.h>\n
18+
PROGRAM-cjson += \#include <math.h>\n
1819
PROGRAM-cjson += \#include <cjson/cJSON.h>\n
19-
PROGRAM-cjson += int main() { return cJSON_False; }
20-
CCFLAGS-cjson = -I$(dir $(MAKEFILE))src
20+
PROGRAM-cjson += int main() { double d = NAN; return cJSON_False; }
21+
CCFLAGS-cjson = -I. -I$(dir $(MAKEFILE))src
2122
PROGRAM-system-cjson = $(PROGRAM-cjson)
22-
CCFLAGS-system-cjson = -lcjson
23+
CCFLAGS-system-cjson = -I. -lcjson
2324

2425
sink:
2526
@echo >&2 Please run from the top-level Makefile.

0 commit comments

Comments
 (0)