Skip to content

Commit

Permalink
use ASAN with gcc and improve makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jaromil committed May 12, 2023
1 parent 3715511 commit 21d60a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@


debug:
mkdir -p build
cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG='-ggdb -fno-omit-frame-pointer -fsanitize=address' -DCMAKE_C_FLAGS_DEBUG='-ggdb -fno-omit-frame-pointer -fsanitize=address' ..
cd build && make


debug-clang-ninja:
mkdir -p build
cd build && cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG='-ggdb -fno-omit-frame-pointer -fsanitize=address' -DCMAKE_C_FLAGS_DEBUG='-ggdb -fno-omit-frame-pointer -fsanitize=address' -G 'Ninja' ..
cd build && ninja
12 changes: 7 additions & 5 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ DEBUG_FLAGS ?= -O0 -g -ggdb -Wl,-undefined -Wl,dynamic_lookup -fsanitize=address
all: test-utils
# build scan-plugins

test-utils: CVFLAGS := $(shell pkg-config --libs --cflags opencv4)
test-utils:
frei0r-test: CVFLAGS := $(shell pkg-config --libs --cflags opencv4)
frei0r-test: frei0r-test.c
${CXX} ${DEBUG_FLAGS} -ggdb -O0 -I../include -o frei0r-test frei0r-test.c ${CVFLAGS} -ldl

test-all-filters: test-utils
test-all-filters: frei0r-test
@$(if $(wildcard ${PLUGINDIR}),,>&2 echo "Scan dir not found: ${PLUGINDIR}" && exit 1)
@find ${PLUGINDIR} -type f -name '*.so' -exec ./frei0r-test -t -v ${HOME}/Videos/the_end.mp4 -p {} \;
@find ${PLUGINDIR} -type f -name '*.so' -exec ./frei0r-test -t -v ${HOME}/Downloads/frei0r-all.webm -p {} \;

# @$(if $(wildcard frei0r-test),,make test-utils)

scan-plugins:
@$(if $(wildcard ${PLUGINDIR}),,>&2 echo "Scan dir not found: ${PLUGINDIR}" && exit 1)
Expand All @@ -37,5 +39,5 @@ build:

clean:
rm -f *.o
rm -f frei0r-info
rm -f frei0r-info frei0r-test
rm -f *.json

0 comments on commit 21d60a0

Please sign in to comment.