| 1 |
# Based on 'fortran/5 static', but: |
| 2 |
# - Uses a subproject dependency |
| 3 |
# - Is an install:true static library to trigger certain codepath (promotion to link_whole) |
| 4 |
# - Does fortran code 'generation' with configure_file |
| 5 |
# - Uses .F90 ext (capital F typically denotes a dependence on preprocessor treatment, which however is not used) |
| 6 |
project('try-static-subproject-dependency', 'fortran') |
| 7 |
|
| 8 |
static_dep = dependency('static_hello', fallback: ['static_hello', 'static_hello_dep']) |
| 9 |
|
| 10 |
mainsrc = 'main_lib.f90' |
| 11 |
mainsrc = configure_file( |
| 12 |
copy: true, |
| 13 |
input: mainsrc, |
| 14 |
output: 'main_lib_output.F90' |
| 15 |
) |
| 16 |
main_lib = library('mainstatic', mainsrc, dependencies: static_dep, install: true) |
| 17 |
main_dep = declare_dependency(link_with: main_lib) |
| 18 |
|
| 19 |
main_exe = executable('main_exe', 'main.f90', dependencies: main_dep) |
| 20 |
test('static_subproject_test', main_exe) |