diff options
-rw-r--r-- | docs/manual.adoc | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/docs/manual.adoc b/docs/manual.adoc index 1b9fdaa..9b55a44 100644 --- a/docs/manual.adoc +++ b/docs/manual.adoc @@ -203,27 +203,15 @@ It's possible to use pugixml in header-only mode. This means that all source cod Note that there are advantages and drawbacks of this approach. Header mode may improve tree traversal/modification performance (because many simple functions will be inlined), if your compiler toolchain does not support link-time optimization, or if you have it turned off (with link-time optimization the performance should be similar to non-header mode). However, since compiler now has to compile pugixml source once for each translation unit that includes it, compilation times may increase noticeably. If you want to use pugixml in header mode but do not need XPath support, you can consider disabling it by using <<PUGIXML_NO_XPATH,PUGIXML_NO_XPATH>> define to improve compilation time. -Enabling header-only mode is a two-step process: - -* You have to define `PUGIXML_HEADER_ONLY` -* You have to include `pugixml.cpp` whenever you include pugixml.hpp - -Both of these are best done via `pugiconfig.hpp` like this: - -[source] ----- -#define PUGIXML_HEADER_ONLY -#include "pugixml.cpp" ----- +To enable header-only mode, you have to define `PUGIXML_HEADER_ONLY`. You can either do it in `pugiconfig.hpp`, or provide them via compiler command-line. Note that it is safe to compile `pugixml.cpp` if `PUGIXML_HEADER_ONLY` is defined - so if you want to i.e. use header-only mode only in Release configuration, you -can include pugixml.cpp in your project (see <<install.building.embed>>), and conditionally enable header-only mode in `pugiconfig.hpp`, i.e.: +can include pugixml.cpp in your project (see <<install.building.embed>>), and conditionally enable header-only mode in `pugiconfig.hpp` like this: [source] ---- #ifndef _DEBUG #define PUGIXML_HEADER_ONLY - #include "pugixml.cpp" #endif ---- |