aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-05-24 14:20:15 +0200
committerLoïc Hoguin <[email protected]>2018-05-24 14:20:15 +0200
commit86346d6cd97fffa37098e7149d1a5fcacbda7f7b (patch)
tree2dfe2650b41fa1004c4e6b18c315eda6e7909512
parentc17e0b1b1ee92099b2d0ca0327fde58cf432345b (diff)
downloadesdl2-86346d6cd97fffa37098e7149d1a5fcacbda7f7b.tar.gz
esdl2-86346d6cd97fffa37098e7149d1a5fcacbda7f7b.tar.bz2
esdl2-86346d6cd97fffa37098e7149d1a5fcacbda7f7b.zip
Use sdl2-config to give SDL2 includes to cppcheck
-rw-r--r--Makefile10
1 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 46e7d70..e49a5fe 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,7 @@ DEP_PLUGINS = nif_helpers
TEST_DEPS = $(if $(CI_ERLANG_MK),ci.erlang.mk)
+SDL2_CFLAGS = $(shell sdl2-config --cflags)
# SDL 2.0.3 has this option enabled that causes problems with NIF functions.
SDL2_LIBS_FILTER_OUT = -Wl,--no-undefined
SDL2_LIBS = $(filter-out $(SDL2_LIBS_FILTER_OUT),$(shell sdl2-config --static-libs))
@@ -32,7 +33,7 @@ include erlang.mk
# SDL2 flags.
-CFLAGS += $(shell sdl2-config --cflags)
+CFLAGS += $(SDL2_CFLAGS)
# @todo -undefined dynamic_lookup on OSX?
LDLIBS += $(SDL2_LIBS) -lSDL2_image -lSDL2_ttf
@@ -45,10 +46,9 @@ ci-setup:: distclean-c_src-env
check:: cppcheck scan-build
cppcheck:
- $(gen_verbose) cppcheck -f -q \
- --error-exitcode=2 --enable=warning,style \
- --inconclusive --std=posix -I/usr/include/SDL2 \
- -U_System -USDL_CreateThread c_src/
+ $(gen_verbose) cppcheck -f -q --error-exitcode=2 \
+ --enable=warning,style --inconclusive --std=posix \
+ $(firstword $(SDL2_CFLAGS)) -U_System -USDL_CreateThread c_src/
scan-build:
$(verbose) $(MAKE) clean