From f3e42969a5118247de548c059e9bed69cdf208bb Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 9 Jan 2015 19:29:23 -0800 Subject: Simplify header-only mode usage It's sufficient to define PUGIXML_HEADER_ONLY anywhere now, source is included automatically. This is a second attempt; this time it includes a workaround for QMake bug that caused it to generate incorrect Makefile. --- src/pugiconfig.hpp | 1 - src/pugixml.hpp | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pugiconfig.hpp b/src/pugiconfig.hpp index 1c216e3..6219dbe 100644 --- a/src/pugiconfig.hpp +++ b/src/pugiconfig.hpp @@ -39,7 +39,6 @@ // Uncomment this to switch to header-only version // #define PUGIXML_HEADER_ONLY -// #include "pugixml.cpp" // Uncomment this to enable long long support // #define PUGIXML_HAS_LONG_LONG diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 917ef4a..2432a3f 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -1329,6 +1329,13 @@ namespace std #endif +// Make sure implementation is included in header-only mode +// Use macro expansion in #include to work around QMake (QTBUG-11923) +#if defined(PUGIXML_HEADER_ONLY) && !defined(PUGIXML_SOURCE) +# define PUGIXML_SOURCE "pugixml.cpp" +# include PUGIXML_SOURCE +#endif + /** * Copyright (c) 2006-2014 Arseny Kapoulkine * -- cgit v1.2.3