Skip to content

Commit 5c5150f

Browse files
committed
Document changes since v7.0.2 in user-facing READMEs
1 parent 7e6f1e2 commit 5c5150f

5 files changed

Lines changed: 56 additions & 8 deletions

File tree

src/compiletools/README.ct-cake.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,28 @@ add, say:
129129
Because the code and build flags are defined so close to each other, its
130130
much easier to tweak the compilation locally.
131131

132+
CPPFLAGS and CXXFLAGS
133+
---------------------
134+
135+
By default, CPPFLAGS and CXXFLAGS are unified into a single deduplicated set.
136+
This means flags specified via ``//#CPPFLAGS=`` or ``--CPPFLAGS`` are also
137+
applied as CXXFLAGS and vice versa. Use ``--separate-flags-CPP-CXX`` to keep
138+
them separate if your build requires different flags for preprocessing and
139+
compilation.
140+
141+
Computed Includes
142+
-----------------
143+
144+
ct-cake's ``direct`` dependency mode (the default) now resolves computed
145+
``#include`` directives where the path is specified via a macro, for example:
146+
147+
.. code-block:: cpp
148+
149+
#define PLATFORM_HEADER "linux_extra.h"
150+
#include PLATFORM_HEADER
151+
152+
Previously this required ``--headerdeps=cpp`` to track correctly.
153+
132154
Performance
133155
===========
134156

src/compiletools/README.ct-commandline.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ OPTIONS
3737
are merged with system and user configs according to precedence rules:
3838
command line > environment variables > config files > defaults.
3939

40+
--include PATH [PATH ...]
41+
Extra path(s) to add to the include search path. Accepts one or more
42+
space-separated paths, e.g. ``--include path/to/headers another/path``.
43+
44+
--CPPFLAGS FLAGS [FLAGS ...]
45+
C preprocessor flags (override). By default unified with CXXFLAGS.
46+
47+
--CXXFLAGS FLAGS [FLAGS ...]
48+
C++ compiler flags (override). By default unified with CPPFLAGS.
49+
50+
--separate-flags-CPP-CXX
51+
Keep CPPFLAGS and CXXFLAGS as separate values instead of merging them.
52+
By default they are unified into a single deduplicated set.
53+
4054
-v, --verbose
4155
Increase output verbosity. Can be specified multiple times for more detail
4256
(e.g., ``-vv`` or ``-v -v``).

src/compiletools/README.ct-cppdeps.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ filename [filename ...]
3030
DESCRIPTION
3131
===========
3232
ct-cppdeps generates the header dependencies for the file you specify at the
33-
command line. There are two possible methodologys:
33+
command line. There are two possible methodologies:
3434

35-
* "--headerdeps=direct" uses a regex to find the "#include" lines in the source
36-
code. This methodology is fast and is supposed to generate the same results as
37-
using the compiler to preprocess the file. However, its own simple
38-
preprocessor does not handle all the complexities of a real C/C++
39-
preprocessor and so it is possible to generate incorrect results.
40-
41-
* "--headerdeps=cpp" executes "$CPP -MM -MF" which is slower but guarantees correctness.
35+
* ``--headerdeps=direct`` (default) uses a built-in preprocessor to find
36+
``#include`` directives. It handles conditional compilation (``#if``,
37+
``#ifdef``, ``#ifndef``, ``#undef``) and computed includes where the path
38+
is specified via a macro, e.g. ``#include PLATFORM_HEADER``. This is fast
39+
and correct for the vast majority of real-world code.
4240

41+
* ``--headerdeps=cpp`` executes ``$CPP -MM -MF``, which is slower but
42+
delegates entirely to the system compiler's preprocessor.
4343

4444
The tool recursively follows #include directives to discover all header files
4545
that the specified source file depends upon, either directly or transitively.

src/compiletools/README.ct-headertree.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ DESCRIPTION
2121
===========
2222
Create a tree of header dependencies starting at a given C/C++ file.
2323

24+
The default ``direct`` mode uses a built-in preprocessor that handles
25+
conditional compilation (``#if``, ``#ifdef``, ``#ifndef``, ``#undef``) and
26+
computed includes (``#include MACRO_NAME``). Use ``--headerdeps=cpp`` to
27+
delegate to the system compiler's preprocessor instead.
28+
2429
OPTIONS
2530
=======
2631
--style {tree,depth,dot,flat}

src/compiletools/README.ct-magicflags.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ preferred over manual ``LDFLAGS`` because:
8989
The PKG-CONFIG magic flag works with any library that provides a .pc file,
9090
including common libraries like gtk+-3.0, libpng, libcurl, openssl, and many more.
9191

92+
CPPFLAGS and CXXFLAGS Unification
93+
==================================
94+
By default, ``CPPFLAGS`` and ``CXXFLAGS`` magic flags are merged into a single
95+
deduplicated set. A flag set via ``//#CPPFLAGS=`` is also applied as a CXXFLAGS
96+
and vice versa. Use ``--separate-flags-CPP-CXX`` on the command line to keep
97+
them separate.
98+
9299
VALID MAGIC FLAGS
93100
=================
94101
A magic flag follows the pattern ``//#key=value``. Whitespace around the

0 commit comments

Comments
 (0)