diff options
author | LKedward <laurence.kedward@bristol.ac.uk> | 2021-03-07 10:56:52 +0000 |
---|---|---|
committer | LKedward <laurence.kedward@bristol.ac.uk> | 2021-03-07 10:56:52 +0000 |
commit | bbd5b02fb604d70b257bc82af1fc41293a44be02 (patch) | |
tree | aa271b79151f5416f67314873b2f3b9c49af9cb4 | |
parent | 240c8cd59ab0554c075af8ee7ab9893ee9bf2aab (diff) | |
download | fpm-bbd5b02fb604d70b257bc82af1fc41293a44be02.tar.gz fpm-bbd5b02fb604d70b257bc82af1fc41293a44be02.zip |
Update: target compile flags with include directories
-rw-r--r-- | fpm/src/fpm_targets.f90 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fpm/src/fpm_targets.f90 b/fpm/src/fpm_targets.f90 index 68cfc97..b6c2e57 100644 --- a/fpm/src/fpm_targets.f90 +++ b/fpm/src/fpm_targets.f90 @@ -433,6 +433,7 @@ subroutine resolve_target_linking(targets, model) integer :: i character(:), allocatable :: global_link_flags + character(:), allocatable :: global_compile_flags if (targets(1)%ptr%target_type == FPM_TARGET_ARCHIVE) then global_link_flags = targets(1)%ptr%output_file @@ -440,17 +441,26 @@ subroutine resolve_target_linking(targets, model) allocate(character(0) :: global_link_flags) end if + global_compile_flags = model%fortran_compile_flags + if (allocated(model%link_libraries)) then if (size(model%link_libraries) > 0) then global_link_flags = global_link_flags // " -l" // string_cat(model%link_libraries," -l") end if end if + if (allocated(model%include_dirs)) then + if (size(model%include_dirs) > 0) then + global_compile_flags = global_compile_flags // & + & " -I" // string_cat(model%include_dirs," -I") + end if + end if + do i=1,size(targets) associate(target => targets(i)%ptr) - target%compile_flags = model%fortran_compile_flags + target%compile_flags = global_compile_flags allocate(target%link_objects(0)) |