From bbd5b02fb604d70b257bc82af1fc41293a44be02 Mon Sep 17 00:00:00 2001 From: LKedward Date: Sun, 7 Mar 2021 10:56:52 +0000 Subject: Update: target compile flags with include directories --- fpm/src/fpm_targets.f90 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3