aboutsummaryrefslogtreecommitdiff
path: root/Docs/source/developers
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2020-04-01 16:33:07 -0700
committerGravatar GitHub <noreply@github.com> 2020-04-01 16:33:07 -0700
commitbc5553db2a0a44cc0dfd2b8323c81b38be025332 (patch)
tree94ef9e17688cade677d735ba30ef0d83f5b27fd4 /Docs/source/developers
parentc4384c4d5e7e7776a360d21ae52a5012f5e7185f (diff)
downloadWarpX-bc5553db2a0a44cc0dfd2b8323c81b38be025332.tar.gz
WarpX-bc5553db2a0a44cc0dfd2b8323c81b38be025332.tar.zst
WarpX-bc5553db2a0a44cc0dfd2b8323c81b38be025332.zip
Developer Docs: Include Guide (#874)
Following these include guides will allow us to catch bugs, e.g. missing includes, early and will avoid problems when using package managers.
Diffstat (limited to 'Docs/source/developers')
-rw-r--r--Docs/source/developers/repo_organization.rst19
1 files changed, 18 insertions, 1 deletions
diff --git a/Docs/source/developers/repo_organization.rst b/Docs/source/developers/repo_organization.rst
index 495cc8fc7..5bc6e65b3 100644
--- a/Docs/source/developers/repo_organization.rst
+++ b/Docs/source/developers/repo_organization.rst
@@ -16,7 +16,24 @@ The main WarpX class is WarpX, implemented in ``Source/WarpX.cpp``.
Build system
------------
-WarpX uses the AMReX build system. Each sub-folder contains a file ``Make.package`` with the names of header files and source files to include for the build.
+WarpX uses the AMReX build system (GNUMake).
+Each sub-folder contains a file ``Make.package`` with the names of source files (``.cpp``) that are added to the build.
+Do not list header files (``.H``) here.
+
+C++ Includes
+------------
+
+All WarpX header files need to be specified relative to the ``Source/`` directory.
+
+- e.g. ``#include "Utils/WarpXConst.H"``
+- files in the same directory as the including header-file can be included with ``#include "FileName.H"``
+
+The `include order <https://github.com/ECP-WarpX/WarpX/pull/874#issuecomment-607038803>`_ and `proper quotation marks <https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html>`_ are:
+
+1. WarpX header files ``#include "..."`` then
+2. AMReX header files ``#include <...>`` then
+3. other third party includes ``#include <...>`` then
+4. standard library includes, e.g. ``#include <vector>``
WarpX-specific vocabulary
-------------------------