Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
12535d1e
Commit
12535d1e
authored
13 years ago
by
Christoph Grüninger
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation for ENABLE_FOO macros to the buildsystem documentation. Fixes FS#631.
[[Imported from SVN: r6656]]
parent
0ae069e7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/buildsystem/buildsystem.tex
+20
-2
20 additions, 2 deletions
doc/buildsystem/buildsystem.tex
with
20 additions
and
2 deletions
doc/buildsystem/buildsystem.tex
+
20
−
2
View file @
12535d1e
...
...
@@ -1114,16 +1114,34 @@ available and which dimension has been selected (if applicable). This
information can then be used at compile
-
time to include header files
or code that depend on optional packages.
As an example, the macro
\lstinline
!
HAVE
_
ARRAY
!
\
can be used to compile
code using C
++
11
arrays as in
\begin
{
lstlisting
}
[
basicstyle
=
\ttfamily\scriptsize
]
#ifdef HAVE
_
ARRAY
#include <array>
std::array <int,
5
> a
=
{
1
,
2
,
3
}
;
#endif
\end
{
lstlisting
}
In some cases the macro
\lstinline
!
HAVE
_
<lib>
!
\
is set to
\lstinline
!
ENABLE
_
<lib>
!
. In this case
\lstinline
!
ENABLE
_
<lib>
!
is
supposed to be either
\texttt
{
false
}
or
\texttt
{
true
}
. It might be
undefined which is equivalent to
\texttt
{
false
}
. Thus the correct usage
is
\lstinline
!
#if HAVE
_
<lib>
!
\
instead of
\lstinline
!
#ifdef HAVE
_
<lib>
!
.
The macro
\lstinline
!
ENABLE
_
<lib>
!
\
is not intended for the user. It
is a trick to move the final definition of
\lstinline
!
HAVE
_
<lib>
!
\
to the command line.
As an example, the macro
\lstinline
!
HAVE
_
UG
!
\
can be used to compile
UG
-
specific code as in
\begin
{
lstlisting
}
[
basicstyle
=
\ttfamily\scriptsize
]
#if HAVE
_
UG
#include
"
dune
/
grid
/
uggrid.hh
"
#include
<
dune
/
grid
/
uggrid.hh
>
#endif
\end
{
lstlisting
}
It is important that the file
\lstinline
!
config.h
!
is the first
include
file
in your application
!
include
d header
in your application
!
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment