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 <thiago.macieira@intel.com>
  • Loading branch information
thiagomacieira committed May 2, 2024
1 parent 4dcad26 commit e4546dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .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 Expand Up @@ -128,7 +128,7 @@ jobs:
eval "$EVAL"
# FIXME: remove -Wno-error-line below.
export CFLAGS="$CFLAGS -Wno-error=implicit-function-declaration"
make OUT=.config -s -f Makefile.configure configure | tee .config
make OUT=.config V=1 -s -f Makefile.configure configure && cat .config
make -k \
CFLAGS="$CFLAGS -march=native -g1 -Wall -Wextra -Werror" \
CPPFLAGS="-DNDEBUG -DCBOR_ENCODER_WRITER_CONTROL=-1 -DCBOR_PARSER_READER_CONTROL=-1" \
Expand Down
3 changes: 2 additions & 1 deletion Makefile.configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ 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; }
PROGRAM-cjson += int main() { double d = NAN; return cJSON_False; }
CCFLAGS-cjson = -I$(dir $(MAKEFILE))src
PROGRAM-system-cjson = $(PROGRAM-cjson)
CCFLAGS-system-cjson = -lcjson
Expand Down

0 comments on commit e4546dd

Please sign in to comment.