From 3e1943785d0b7335c772c09ec5a6e830ddd06af1 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Wed, 19 Jul 2023 08:44:36 +0200 Subject: [PATCH 1/2] document dependency-specific macro settings --- pages/spec/manifest.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pages/spec/manifest.md b/pages/spec/manifest.md index 4fb6b2178..eb0cee068 100644 --- a/pages/spec/manifest.md +++ b/pages/spec/manifest.md @@ -491,6 +491,16 @@ my-utils = { path = "utils" } The local dependency path is given relative to the ``fpm.toml`` it is written to, and uses ``/`` as the path separator on all platforms. +### Dependency-specific macro setting + +As of ``fpm>=0.9.1``, an array of dependency-specific macros can be passed to a dependency only from the manifest, in the same fashion as in the manifest's [preprocessor configuration](#preprocessor-configuration) table. 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 collision occurs. +For example, one can control the `REAL` precision that one library is to be used with: + +```toml +[dependencies] +fftpack = { git="https://github.com/fortran-lang/fftpack.git", preprocess.cpp.macros = ["REAL32"] } +``` + ## Global config file 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). From e3d560caf6d801b4451ad1d09306a7541dd84138 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Wed, 19 Jul 2023 08:47:26 +0200 Subject: [PATCH 2/2] Improve language --- pages/spec/manifest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/spec/manifest.md b/pages/spec/manifest.md index eb0cee068..8c7d48ce9 100644 --- a/pages/spec/manifest.md +++ b/pages/spec/manifest.md @@ -493,7 +493,7 @@ The local dependency path is given relative to the ``fpm.toml`` it is written to ### Dependency-specific macro setting -As of ``fpm>=0.9.1``, an array of dependency-specific macros can be passed to a dependency only from the manifest, in the same fashion as in the manifest's [preprocessor configuration](#preprocessor-configuration) table. 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 collision occurs. +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. For example, one can control the `REAL` precision that one library is to be used with: ```toml