From 12ffad5a8b2b1df86cf012309ed1c891e2180c21 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sun, 9 Jul 2023 22:40:25 +0200 Subject: [PATCH] chore(cpp): support catch for tests Signed-off-by: Matej Focko --- .common/makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.common/makefile b/.common/makefile index 58c3485..31bc2b7 100644 --- a/.common/makefile +++ b/.common/makefile @@ -1,8 +1,11 @@ CXX=clang++ CXXFLAGS=-std=c++20 -Wall -Wextra -%: format %.cpp - $(CXX) $(CXXFLAGS) -g $^ -o $@ +catch2.o: ../.common/catch_amalgamated.cpp ../.common/catch_amalgamated.hpp + $(CXX) $(CXXFLAGS) -g -c ../.common/catch_amalgamated.cpp -o catch2.o + +%: catch2.o %.cpp + $(CXX) $(CXXFLAGS) -DTEST -g $^ -o $@ format: clang-format -i -style=google *.cpp