Skip to content

Commit 172cfc4

Browse files
authored
Document dependency-specific macro settings (#120)
* document dependency-specific macro settings * Improve language
1 parent 9801c15 commit 172cfc4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pages/spec/manifest.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,16 @@ my-utils = { path = "utils" }
491491

492492
The local dependency path is given relative to the ``fpm.toml`` it is written to, and uses ``/`` as the path separator on all platforms.
493493

494+
### Dependency-specific macro setting
495+
496+
As of ``fpm>=0.9.1``, an array of dependency-specific macros can be passed to a single dependency from the manifest, in the same fashion as in the manifest's [preprocessor configuration](#preprocessor-configuration) table. Its `preprocess` table needs to be entered as part of the dependency entry. fpm will not check if the passed macros collide with the dependencie's own manifest, so, it is the user's responsibility to ensure that no collisions or unexpected behavior occur.
497+
For example, one can control the `REAL` precision that one library is to be used with:
498+
499+
```toml
500+
[dependencies]
501+
fftpack = { git="https://github.com/fortran-lang/fftpack.git", preprocess.cpp.macros = ["REAL32"] }
502+
```
503+
494504
## Global config file
495505

496506
The global configuration file can be used to set default options across all fpm projects on the system. It is, by default, located at `~/.local/share/fpm/config.toml` on Unix-like machines and `%APPDATA%\local\fpm\config.toml` on Windows and must be parsable to a TOML structure. It can be used to configure [registry settings](#registry-settings).

0 commit comments

Comments
 (0)