Skip to content
Snippets Groups Projects
Commit d4f9047b authored by Arseny Kapoulkine's avatar Arseny Kapoulkine
Browse files

docs: Fix PUGIXML_HEADER_ONLY description

Users no longer need to #include "pugixml.cpp"
parent 11054219
No related branches found
No related tags found
No related merge requests found
......@@ -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
----
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment