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 a649671
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
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 a649671

Please sign in to comment.