Update pugixml library, no override patches anymore (nw)

This commit is contained in:
Miodrag Milanovic 2016-11-03 20:13:19 +01:00
parent 07c8a7f1a9
commit 093609dc0c
10 changed files with 50 additions and 18 deletions

View File

@ -1 +1,2 @@
build/
.vscode/

View File

@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 2.6)
option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF)
option(BUILD_TESTS "Build tests" OFF)
option(BUILD_PKGCONFIG "Build in PKGCONFIG mode" OFF)
set(BUILD_DEFINES "" CACHE STRING "Build defines")
if(MSVC)
@ -46,16 +48,25 @@ if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 3.1 AND ";${CMAKE_C
endif()
set_target_properties(pugixml PROPERTIES VERSION 1.7 SOVERSION 1)
get_target_property(PUGIXML_VERSION_STRING pugixml VERSION)
if(BUILD_PKGCONFIG)
# Install library into its own directory under LIBDIR
set(INSTALL_SUFFIX /pugixml-${PUGIXML_VERSION_STRING})
endif()
install(TARGETS pugixml EXPORT pugixml-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${INSTALL_SUFFIX})
install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml)
if(BUILD_PKGCONFIG)
configure_file(scripts/pugixml.pc.in ${PROJECT_BINARY_DIR}/pugixml.pc @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
endif()
if(BUILD_TESTS)
file(GLOB TEST_SOURCES tests/*.cpp)
file(GLOB FUZZ_SOURCES tests/fuzz_*.cpp)

View File

@ -25,7 +25,7 @@ The distribution contains library source, documentation (the guide you're readin
The complete pugixml source consists of three files - one source file, `pugixml.cpp`, and two header files, `pugixml.hpp` and `pugiconfig.hpp`. `pugixml.hpp` is the primary header which you need to include in order to use pugixml classes/functions. The rest of this guide assumes that `pugixml.hpp` is either in the current directory or in one of include directories of your projects, so that `#include "pugixml.hpp"` can find the header; however you can also use relative path (i.e. `#include "../libs/pugixml/src/pugixml.hpp"`) or include directory-relative path (i.e. `#include <xml/thirdparty/pugixml/src/pugixml.hpp>`).
The easiest way to build pugixml is to compile the source file, `pugixml.cpp`, along with the existing library/executable. This process depends on the method of building your application; for example, if you're using Microsoft Visual Studio footnote:[All trademarks used are properties of their respective owners.], Apple Xcode, Code::Blocks or any other IDE, just add `pugixml.cpp` to one of your projects. There are other building methods available, including building pugixml as a standalone static/shared library; link:manual/install.html#install.building[read the manual] for further information.
The easiest way to build pugixml is to compile the source file, `pugixml.cpp`, along with the existing library/executable. This process depends on the method of building your application; for example, if you're using Microsoft Visual Studio footnote:[All trademarks used are properties of their respective owners.], Apple Xcode, Code::Blocks or any other IDE, just add `pugixml.cpp` to one of your projects. There are other building methods available, including building pugixml as a standalone static/shared library; link:manual.html#install.building[read the manual] for further information.
[[dom]]
== Document object model

11
3rdparty/pugixml/scripts/pugixml.pc.in vendored Normal file
View File

@ -0,0 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include/pugixml-@PUGIXML_VERSION_STRING@
libdir=${exec_prefix}/lib/pugixml-@PUGIXML_VERSION_STRING@
Name: pugixml
Description: Light-weight, simple and fast XML parser for C++ with XPath support.
URL: http://pugixml.org/
Version: @PUGIXML_VERSION_STRING@
Cflags: -I${includedir}
Libs: -L${libdir} -lpugixml

View File

@ -72,6 +72,15 @@
# endif
#endif
// If C++ is 2011 or higher, add 'override' qualifiers
#ifndef PUGIXML_OVERRIDE
# if __cplusplus >= 201103
# define PUGIXML_OVERRIDE override
# else
# define PUGIXML_OVERRIDE
# endif
#endif
// Character interface macros
#ifdef PUGIXML_WCHAR_MODE
# define PUGIXML_TEXT(t) L ## t
@ -273,7 +282,7 @@ namespace pugi
// Construct writer from a FILE* object; void* is used to avoid header dependencies on stdio
xml_writer_file(void* file);
virtual void write(const void* data, size_t size) override;
virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
private:
void* file;
@ -288,7 +297,7 @@ namespace pugi
xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream);
xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream);
virtual void write(const void* data, size_t size) override;
virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
private:
std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
@ -1214,7 +1223,7 @@ namespace pugi
explicit xpath_exception(const xpath_parse_result& result);
// Get error message
virtual const char* what() const throw() override;
virtual const char* what() const throw() PUGIXML_OVERRIDE;
// Get parse result
const xpath_parse_result& result() const;

View File

@ -78,7 +78,7 @@ struct dummy_fixture {};
{ \
test_runner_##name(): test_runner(#name) {} \
\
virtual void run() \
virtual void run() PUGIXML_OVERRIDE \
{ \
test_runner_helper_##name helper; \
helper.run(); \

View File

@ -187,7 +187,7 @@ public:
this->setg(begin, begin, end);
}
typename std::basic_streambuf<T>::int_type underflow()
typename std::basic_streambuf<T>::int_type underflow() PUGIXML_OVERRIDE
{
return this->gptr() == this->egptr() ? std::basic_streambuf<T>::traits_type::eof() : std::basic_streambuf<T>::traits_type::to_int_type(*this->gptr());
}

View File

@ -798,7 +798,7 @@ struct test_walker: xml_tree_walker
#endif
}
virtual bool begin(xml_node& node)
virtual bool begin(xml_node& node) PUGIXML_OVERRIDE
{
log += STR("|");
log += depthstr();
@ -810,7 +810,7 @@ struct test_walker: xml_tree_walker
return ++call_count != stop_count && xml_tree_walker::begin(node);
}
virtual bool for_each(xml_node& node)
virtual bool for_each(xml_node& node) PUGIXML_OVERRIDE
{
log += STR("|");
log += depthstr();
@ -822,7 +822,7 @@ struct test_walker: xml_tree_walker
return ++call_count != stop_count && xml_tree_walker::end(node);
}
virtual bool end(xml_node& node)
virtual bool end(xml_node& node) PUGIXML_OVERRIDE
{
log += STR("|");
log += depthstr();

View File

@ -213,7 +213,7 @@ struct test_writer: xml_writer
{
std::basic_string<pugi::char_t> contents;
virtual void write(const void* data, size_t size)
virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE
{
CHECK(size % sizeof(pugi::char_t) == 0);
contents.append(static_cast<const pugi::char_t*>(data), size / sizeof(pugi::char_t));
@ -604,7 +604,7 @@ TEST_XML_FLAGS(write_mixed, "<node><child1/><child2>pre<![CDATA[data]]>mid<!--co
#ifndef PUGIXML_NO_EXCEPTIONS
struct throwing_writer: pugi::xml_writer
{
virtual void write(const void*, size_t)
virtual void write(const void*, size_t) PUGIXML_OVERRIDE
{
throw std::runtime_error("write failed");
}

View File

@ -9,7 +9,7 @@ struct xml_writer_string: public pugi::xml_writer
{
std::string contents;
virtual void write(const void* data, size_t size);
virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
std::string as_narrow() const;
std::basic_string<wchar_t> as_wide() const;