aboutsummaryrefslogtreecommitdiff
path: root/example_packages
diff options
context:
space:
mode:
authorSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2020-11-10 20:28:43 +0100
committerSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2020-11-13 09:34:56 +0100
commitfcc971fd8703c37b8e0e02dabfe95138b4979309 (patch)
treeb136962c5f5de1543c450ac4e0954504fd5e0804 /example_packages
parentcc7fc6ec36b9075f3709864e17301b691cf6b870 (diff)
downloadfpm-fcc971fd8703c37b8e0e02dabfe95138b4979309.tar.gz
fpm-fcc971fd8703c37b8e0e02dabfe95138b4979309.zip
Allow external link dependencies with scope limited to targets
- move reader for string list to toml-f proxy - allow link entry in executable and test tables - bump toml-f version to v0.2.1 - add example package linking a single executable against gomp
Diffstat (limited to 'example_packages')
-rw-r--r--example_packages/README.md1
-rw-r--r--example_packages/link_executable/.gitignore1
-rw-r--r--example_packages/link_executable/app/main.f9011
-rw-r--r--example_packages/link_executable/fpm.toml8
4 files changed, 21 insertions, 0 deletions
diff --git a/example_packages/README.md b/example_packages/README.md
index 95f28d7..0eb0653 100644
--- a/example_packages/README.md
+++ b/example_packages/README.md
@@ -17,5 +17,6 @@ the features demonstrated in each package and which versions of fpm are supporte
| program_with_module | App-only; module+program in single source file | Y | Y |
| submodules | Lib-only; submodules (3 levels) | N | Y |
| link_external | Link external library | N | Y |
+| link_executable | Link external library to a single executable | N | Y |
| with_c | Compile with `c` source files | N | Y |
| with_makefile | External build command (makefile) | Y | N |
diff --git a/example_packages/link_executable/.gitignore b/example_packages/link_executable/.gitignore
new file mode 100644
index 0000000..a007fea
--- /dev/null
+++ b/example_packages/link_executable/.gitignore
@@ -0,0 +1 @@
+build/*
diff --git a/example_packages/link_executable/app/main.f90 b/example_packages/link_executable/app/main.f90
new file mode 100644
index 0000000..b1df402
--- /dev/null
+++ b/example_packages/link_executable/app/main.f90
@@ -0,0 +1,11 @@
+program gomp_example
+ implicit none
+
+ interface
+ integer function omp_get_num_procs()
+ end function
+ end interface
+
+ print *, omp_get_num_procs()
+
+end program gomp_example
diff --git a/example_packages/link_executable/fpm.toml b/example_packages/link_executable/fpm.toml
new file mode 100644
index 0000000..f3545ca
--- /dev/null
+++ b/example_packages/link_executable/fpm.toml
@@ -0,0 +1,8 @@
+name = "link_executable"
+build.auto-executables = false
+
+[[executable]]
+name = "gomp_test"
+source-dir = "app"
+main = "main.f90"
+link = ["gomp"]