Skip to content

Commit b4bc385

Browse files
committed
add compile_commands_table_t to the build backend
1 parent 99d067f commit b4bc385

File tree

2 files changed

+190
-183
lines changed

2 files changed

+190
-183
lines changed

src/fpm_backend.F90

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module fpm_backend
3636
FPM_TARGET_C_OBJECT, FPM_TARGET_ARCHIVE, FPM_TARGET_EXECUTABLE, &
3737
FPM_TARGET_CPP_OBJECT
3838
use fpm_backend_output
39+
use fpm_compile_commands, only: compile_command_table_t
3940
implicit none
4041

4142
private
@@ -125,7 +126,7 @@ subroutine build_package(targets,model,verbose)
125126

126127
if (.not.skip_current) then
127128
call progress%compiling_status(j)
128-
call build_target(model,queue(j)%ptr,verbose,stat(j))
129+
call build_target(model,queue(j)%ptr,verbose,progress%compile_commands,stat(j))
129130
call progress%completed_status(j,stat(j))
130131
end if
131132

@@ -300,10 +301,11 @@ end subroutine schedule_targets
300301
!>
301302
!> If successful, also caches the source file digest to disk.
302303
!>
303-
subroutine build_target(model,target,verbose,stat)
304+
subroutine build_target(model,target,verbose,table,stat)
304305
type(fpm_model_t), intent(in) :: model
305306
type(build_target_t), intent(in), target :: target
306307
logical, intent(in) :: verbose
308+
type(compile_command_table_t), intent(inout) :: table
307309
integer, intent(out) :: stat
308310

309311
integer :: fh
@@ -318,15 +320,15 @@ subroutine build_target(model,target,verbose,stat)
318320

319321
case (FPM_TARGET_OBJECT)
320322
call model%compiler%compile_fortran(target%source%file_name, target%output_file, &
321-
& target%compile_flags, target%output_log_file, stat)
323+
& target%compile_flags, target%output_log_file, stat, table)
322324

323325
case (FPM_TARGET_C_OBJECT)
324326
call model%compiler%compile_c(target%source%file_name, target%output_file, &
325-
& target%compile_flags, target%output_log_file, stat)
327+
& target%compile_flags, target%output_log_file, stat, table)
326328

327329
case (FPM_TARGET_CPP_OBJECT)
328330
call model%compiler%compile_cpp(target%source%file_name, target%output_file, &
329-
& target%compile_flags, target%output_log_file, stat)
331+
& target%compile_flags, target%output_log_file, stat, table)
330332

331333
case (FPM_TARGET_EXECUTABLE)
332334
call model%compiler%link(target%output_file, &

0 commit comments

Comments
 (0)