Skip to content

Commit 294f71b

Browse files
committed
fix: set cxx compiler in fpm_<xxx>_settings and also renamed cpp to cxx at left out places
1 parent c83802d commit 294f71b

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/fpm.f90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ subroutine build_model(model, settings, package, error)
9494

9595
model%fortran_compile_flags = flags
9696
model%c_compile_flags = cflags
97-
model%cpp_compile_flags = cxxflags
97+
model%cxx_compile_flags = cxxflags
9898
model%link_flags = ldflags
9999

100100
model%include_tests = settings%build_tests
@@ -219,8 +219,10 @@ subroutine build_model(model, settings, package, error)
219219
write(*,*)'<INFO> BUILD_NAME: ',model%build_prefix
220220
write(*,*)'<INFO> COMPILER: ',model%compiler%fc
221221
write(*,*)'<INFO> C COMPILER: ',model%compiler%cc
222+
write(*,*)'<INFO> CXX COMPILER: ',model%compiler%cxx
222223
write(*,*)'<INFO> COMPILER OPTIONS: ', model%fortran_compile_flags
223224
write(*,*)'<INFO> C COMPILER OPTIONS: ', model%c_compile_flags
225+
write(*,*)'<INFO> CXX COMPILER OPTIONS: ', model%cxx_compile_flags
224226
write(*,*)'<INFO> LINKER OPTIONS: ', model%link_flags
225227
write(*,*)'<INFO> INCLUDE DIRECTORIES: [', string_cat(model%include_dirs,','),']'
226228
end if

src/fpm_command_line.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ subroutine get_command_line_settings(cmd_settings)
302302
& prune=.not.lget('no-prune'), &
303303
& compiler=val_compiler, &
304304
& c_compiler=c_compiler, &
305+
& cxx_compiler=cxx_compiler, &
305306
& archiver=archiver, &
306307
& flag=val_flag, &
307308
& cflag=val_cflag, &
@@ -332,6 +333,7 @@ subroutine get_command_line_settings(cmd_settings)
332333
& prune=.not.lget('no-prune'), &
333334
& compiler=val_compiler, &
334335
& c_compiler=c_compiler, &
336+
& cxx_compiler=cxx_compiler, &
335337
& archiver=archiver, &
336338
& flag=val_flag, &
337339
& cflag=val_cflag, &
@@ -488,6 +490,7 @@ subroutine get_command_line_settings(cmd_settings)
488490
prune=.not.lget('no-prune'), &
489491
compiler=val_compiler, &
490492
c_compiler=c_compiler, &
493+
cxx_compiler=cxx_compiler, &
491494
archiver=archiver, &
492495
flag=val_flag, &
493496
cflag=val_cflag, &
@@ -545,6 +548,7 @@ subroutine get_command_line_settings(cmd_settings)
545548
& prune=.not.lget('no-prune'), &
546549
& compiler=val_compiler, &
547550
& c_compiler=c_compiler, &
551+
& cxx_compiler=cxx_compiler, &
548552
& archiver=archiver, &
549553
& flag=val_flag, &
550554
& cflag=val_cflag, &

src/fpm_model.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ module fpm_model
156156
character(:), allocatable :: c_compile_flags
157157

158158
!> Command line flags passed to C++ for compilation
159-
character(:), allocatable :: cpp_compile_flags
159+
character(:), allocatable :: cxx_compile_flags
160160

161161
!> Command line flags passed to the linker
162162
character(:), allocatable :: link_flags
@@ -322,7 +322,7 @@ function info_model(model) result(s)
322322
! character(:), allocatable :: fortran_compile_flags
323323
s = s // ', fortran_compile_flags="' // model%fortran_compile_flags // '"'
324324
s = s // ', c_compile_flags="' // model%c_compile_flags // '"'
325-
s = s // ', cpp_compile_flags="' // model%cpp_compile_flags // '"'
325+
s = s // ', cxx_compile_flags="' // model%cxx_compile_flags // '"'
326326
s = s // ', link_flags="' // model%link_flags // '"'
327327
s = s // ', build_prefix="' // model%build_prefix // '"'
328328
! type(string_t), allocatable :: link_libraries(:)

src/fpm_targets.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ subroutine resolve_target_linking(targets, model)
743743
else if (target%target_type == FPM_TARGET_C_OBJECT) then
744744
target%compile_flags = model%c_compile_flags
745745
else if(target%target_type == FPM_TARGET_CPP_OBJECT) then
746-
target%compile_flags = model%cpp_compile_flags
746+
target%compile_flags = model%cxx_compile_flags
747747
end if
748748

749749
!> Get macros as flags.

0 commit comments

Comments
 (0)