Vendor pugixml

This commit is contained in:
jaseg 2021-02-27 20:08:48 +01:00
parent 901efc75c6
commit 3d2aefe4d9
5 changed files with 93 additions and 4 deletions

3
.gitmodules vendored
View file

@ -16,3 +16,6 @@
[submodule "upstream/subprocess.h"]
path = upstream/subprocess.h
url = https://github.com/sheredom/subprocess.h
[submodule "upstream/pugixml"]
path = upstream/pugixml
url = https://github.com/zeux/pugixml

View file

@ -26,18 +26,26 @@ SOURCES := src/svg_color.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
PUGIXML_SOURCES ?= $(UPSTREAM_DIR)/pugixml/src/pugixml.cpp
CLIPPER_INCLUDES ?= -I$(UPSTREAM_DIR)/clipper-6.4.2/cpp -I$(UPSTREAM_DIR)/clipper-6.4.2/cpp/cpp_cairo/
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
ARGAGG_INCLUDES ?= -I$(UPSTREAM_DIR)/argagg/include/argagg
CAVC_INCLUDES ?= -I$(UPSTREAM_DIR)/CavalierContours/include/cavc/
# the folder name is subprocess.h
SUBPROCESS_INCLUDES ?= -I$(UPSTREAM_DIR)/subprocess.h
# make sure this appears after -Isvg-flatten/src on the compiler cmdline so pugixml loads the correct config
PUGIXML_INCLUDES ?= -I$(UPSTREAM_DIR)/pugixml/src
DEP_INCLUDES := $(CLIPPER_INCLUDES) $(VORONOI_INCLUDES) $(POISSON_INCLUDES) $(BASE64_INCLUDES) $(ARGAGG_INCLUDES)\
$(CAVC_INCLUDES) $(SUBPROCESS_INCLUDES) $(PUGIXML_INCLUDES)
SOURCES += $(CLIPPER_SOURCES)
INCLUDES := -Iinclude -Isrc $(CLIPPER_INCLUDES) $(VORONOI_INCLUDES) $(POISSON_INCLUDES) $(BASE64_INCLUDES) $(ARGAGG_INCLUDES) $(CAVC_INCLUDES) $(SUBPROCESS_INCLUDES)
SOURCES += $(PUGIXML_SOURCES)
INCLUDES := -Iinclude -Isrc $(DEP_INCLUDES)
PKG_CONFIG_DEPS := pangocairo pugixml
PKG_CONFIG_DEPS := cairo
CXXFLAGS := -std=c++2a -g -Wall -Wextra -O0
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_DEPS))
# hack for stone age opencv in debian stable
@ -56,7 +64,7 @@ all: $(BUILDDIR)/$(TARGET)
.PHONY: check-deps
check-deps:
@echo
@$(PKG_CONFIG) --cflags --libs pangocairo pugixml >/dev/null
@$(PKG_CONFIG) --cflags --libs cairo >/dev/null
# debian hack. see above.
@$(PKG_CONFIG) --cflags --libs opencv4 >/dev/null ||$(PKG_CONFIG) --cflags --libs opencv >/dev/null

View file

@ -0,0 +1,77 @@
/**
* pugixml parser - version 1.11
* --------------------------------------------------------
* Copyright (C) 2006-2020, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
* of this file.
*
* This work is based on the pugxml parser, which is:
* Copyright (C) 2003, by Kristen Wegner (kristen@tima.net)
*/
#ifndef HEADER_PUGICONFIG_HPP
#define HEADER_PUGICONFIG_HPP
// Uncomment this to enable wchar_t mode
// #define PUGIXML_WCHAR_MODE
// Uncomment this to enable compact mode
// #define PUGIXML_COMPACT
// Uncomment this to disable XPath
#define PUGIXML_NO_XPATH
// Uncomment this to disable STL
#define PUGIXML_NO_STL
// Uncomment this to disable exceptions
// #define PUGIXML_NO_EXCEPTIONS
// Set this to control attributes for public classes/functions, i.e.:
// #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL
// #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL
// #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall
// In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead
// Tune these constants to adjust memory-related behavior
// #define PUGIXML_MEMORY_PAGE_SIZE 32768
// #define PUGIXML_MEMORY_OUTPUT_STACK 10240
// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096
// Tune this constant to adjust max nesting for XPath queries
// #define PUGIXML_XPATH_DEPTH_LIMIT 1024
// Uncomment this to switch to header-only version
// #define PUGIXML_HEADER_ONLY
// Uncomment this to enable long long support
// #define PUGIXML_HAS_LONG_LONG
#endif
/**
* Copyright (c) 2006-2020 Arseny Kapoulkine
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/

View file

@ -29,7 +29,7 @@
#include <sstream>
#include <regex>
#include <pango/pangocairo.h>
#include <cairo.h>
#include <cairo-svg.h>
#include <clipper.hpp>

1
upstream/pugixml Submodule

@ -0,0 +1 @@
Subproject commit 08b3433180727ea2f78fe02e860a08471db1e03c