Skip to content

Commit 581ec60

Browse files
committed
Add specification for build.link in manifest reference
1 parent b1fddf3 commit 581ec60

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

manifest-reference.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Every manifest file consists of the following sections:
2929
Toggle automatic discovery of test executables
3030
- [*auto-executables*](#automatic-target-discovery):
3131
Toggle automatic discovery of executables
32+
- [*link*](#link-external-libraries):
33+
Link with external dependencies
3234
- Target sections:
3335
- [*library*](#library-configuration)
3436
Configuration of the library target
@@ -282,6 +284,32 @@ helloff = { git = "https://gitlab.com/everythingfunctional/helloff.git" }
282284
```
283285

284286

287+
## Link external libraries
288+
289+
> Supported in Fortran fpm only
290+
291+
To declare link time dependencies on external libraries a list of native libraries can be specified in the *link* entry.
292+
Specify either one library as string or a list of strings in case several libraries should be linked.
293+
When possible the project should only link one native library.
294+
The list of library dependencies is exported to dependent packages.
295+
296+
*Example:*
297+
298+
To link against the zlib compression library use
299+
300+
```toml
301+
link = "z"
302+
```
303+
304+
To dependent on LAPACK also BLAS should be linked.
305+
In this case the order of the libraries matters:
306+
307+
```toml
308+
[build]
309+
link = ["blas", "lapack"]
310+
```
311+
312+
285313
## Automatic target discovery
286314

287315
> Supported in Fortran fpm only

0 commit comments

Comments
 (0)