From 1180ebdc1f18044a74f22f17b4d500ce7d6543fa Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 25 Apr 2021 00:09:57 +0200 Subject: Remove cairo dependency We initially used Cairo for its bezier flattening algorithm. That algorithm turned out to be a bit too imprecise at the scales we're working at here (#17), so I ended up porting over some code from Antigrain Graphics. The only other thing we used Cairo for was debug output and coordinate transforms, so I just wrote the relevant vector math in a small header file, deleted all debug output code and thus eliminated the cairo dependency. This is a step towards Windows builds. --- svg-flatten/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'svg-flatten/Makefile') diff --git a/svg-flatten/Makefile b/svg-flatten/Makefile index ca776d3..a82094c 100644 --- a/svg-flatten/Makefile +++ b/svg-flatten/Makefile @@ -24,10 +24,11 @@ SOURCES := src/svg_color.cpp \ src/out_flattener.cpp \ src/out_dilater.cpp \ src/lambda_sink.cpp \ + src/flatten.cpp \ $(UPSTREAM_DIR)/cpp-base64/base64.cpp -CLIPPER_SOURCES ?= $(UPSTREAM_DIR)/clipper-6.4.2/cpp/clipper.cpp $(UPSTREAM_DIR)/clipper-6.4.2/cpp/cpp_cairo/cairo_clipper.cpp -CLIPPER_INCLUDES ?= -I$(UPSTREAM_DIR)/clipper-6.4.2/cpp -I$(UPSTREAM_DIR)/clipper-6.4.2/cpp/cpp_cairo/ +CLIPPER_SOURCES ?= $(UPSTREAM_DIR)/clipper-6.4.2/cpp/clipper.cpp +CLIPPER_INCLUDES ?= -I$(UPSTREAM_DIR)/clipper-6.4.2/cpp VORONOI_INCLUDES ?= -I$(UPSTREAM_DIR)/voronoi/src POISSON_INCLUDES ?= -I$(UPSTREAM_DIR)/poisson-disk-sampling/thinks/poisson_disk_sampling/ BASE64_INCLUDES ?= -I$(UPSTREAM_DIR)/cpp-base64 @@ -38,7 +39,7 @@ SUBPROCESS_INCLUDES ?= -I$(UPSTREAM_DIR)/subprocess.h SOURCES += $(CLIPPER_SOURCES) INCLUDES := -Iinclude -Isrc $(CLIPPER_INCLUDES) $(VORONOI_INCLUDES) $(POISSON_INCLUDES) $(BASE64_INCLUDES) $(ARGAGG_INCLUDES) $(CAVC_INCLUDES) $(SUBPROCESS_INCLUDES) -PKG_CONFIG_DEPS := pangocairo pugixml +PKG_CONFIG_DEPS := pugixml CXXFLAGS := -std=c++2a -g -Wall -Wextra -O0 CXXFLAGS += $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_DEPS)) # hack for stone age opencv in debian stable @@ -57,7 +58,7 @@ all: $(BUILDDIR)/$(TARGET) .PHONY: check-deps check-deps: @echo - @$(PKG_CONFIG) --cflags --libs pangocairo pugixml >/dev/null + @$(PKG_CONFIG) --cflags --libs pugixml >/dev/null # debian hack. see above. @$(PKG_CONFIG) --cflags --libs opencv4 >/dev/null ||$(PKG_CONFIG) --cflags --libs opencv >/dev/null -- cgit