aboutsummaryrefslogtreecommitdiff
path: root/manifest-reference.md
diff options
context:
space:
mode:
authorSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2020-11-14 15:52:02 +0100
committerGitHub <noreply@github.com>2020-11-14 15:52:02 +0100
commit93cc44017e413a32188fed34dd60d4b710ad5ac3 (patch)
treeb136962c5f5de1543c450ac4e0954504fd5e0804 /manifest-reference.md
parentb1fddf3a0e81d5edb65f25412be1c3e4e0539d58 (diff)
parentfcc971fd8703c37b8e0e02dabfe95138b4979309 (diff)
downloadfpm-93cc44017e413a32188fed34dd60d4b710ad5ac3.tar.gz
fpm-93cc44017e413a32188fed34dd60d4b710ad5ac3.zip
Merge pull request https://github.com/fortran-lang/fpm/pull/233 from awvwgk/link
Allow linking against external libraries
Diffstat (limited to 'manifest-reference.md')
-rw-r--r--manifest-reference.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/manifest-reference.md b/manifest-reference.md
index 5f0227a..63a533f 100644
--- a/manifest-reference.md
+++ b/manifest-reference.md
@@ -29,6 +29,8 @@ Every manifest file consists of the following sections:
Toggle automatic discovery of test executables
- [*auto-executables*](#automatic-target-discovery):
Toggle automatic discovery of executables
+ - [*link*](#link-external-libraries):
+ Link with external dependencies
- Target sections:
- [*library*](#library-configuration)
Configuration of the library target
@@ -228,6 +230,11 @@ See [specifying dependencies](#specifying-dependencies) for more details.
> Dependencies supported in Bootstrap fpm only
+Executables can also specify their own external library dependencies.
+See [external libraries](#link-external-libraries) for more details.
+
+> Linking against libraries is supported in Fortran fpm only
+
*Example:*
```toml
@@ -238,6 +245,7 @@ main = "program.f90"
[[ executable ]]
name = "app-tool"
+link = "z"
[executable.dependencies]
helloff = { git = "https://gitlab.com/everythingfunctional/helloff.git" }
```
@@ -267,6 +275,11 @@ See [specifying dependencies](#specifying-dependencies) for more details.
> Dependencies supported in Bootstrap fpm only
+Tests can also specify their own external library dependencies.
+See [external libraries](#link-external-libraries) for more details.
+
+> Linking against libraries is supported in Fortran fpm only
+
*Example:*
```toml
@@ -277,11 +290,39 @@ main = "tester.F90"
[[ test ]]
name = "tester"
+link = ["blas", "lapack"]
[test.dependencies]
helloff = { git = "https://gitlab.com/everythingfunctional/helloff.git" }
```
+## Link external libraries
+
+> Supported in Fortran fpm only
+
+To declare link time dependencies on external libraries a list of native libraries can be specified in the *link* entry.
+Specify either one library as string or a list of strings in case several libraries should be linked.
+When possible the project should only link one native library.
+The list of library dependencies is exported to dependent packages.
+
+*Example:*
+
+To link against the zlib compression library use
+
+```toml
+[build]
+link = "z"
+```
+
+To dependent on LAPACK also BLAS should be linked.
+In this case the order of the libraries matters:
+
+```toml
+[build]
+link = ["blas", "lapack"]
+```
+
+
## Automatic target discovery
> Supported in Fortran fpm only