@@ -79,6 +79,7 @@ module fpm_command_line
7979 character (len= :),allocatable :: profile
8080 character (len= :),allocatable :: flag
8181 character (len= :),allocatable :: cflag
82+ character (len= :),allocatable :: cxxflag
8283 character (len= :),allocatable :: ldflag
8384end type
8485
@@ -129,7 +130,7 @@ module fpm_command_line
129130& ' ' , ' fpm' , ' new' , ' build' , ' run' , ' clean' , &
130131& ' test' , ' runner' , ' install' , ' update' , ' list' , ' help' , ' version' ]
131132
132- character (len= :), allocatable :: val_runner, val_compiler, val_flag, val_cflag, val_ldflag, &
133+ character (len= :), allocatable :: val_runner, val_compiler, val_flag, val_cflag, val_cxxflag, val_ldflag, &
133134 val_profile
134135
135136! '12345678901234567890123456789012345678901234567890123456789012345678901234567890',&
@@ -201,7 +202,7 @@ subroutine get_command_line_settings(cmd_settings)
201202 & c_compiler, cpp_compiler, archiver
202203
203204 character (len=* ), parameter :: fc_env = " FC" , cc_env = " CC" , ar_env = " AR" , &
204- & fflags_env = " FFLAGS" , cflags_env = " CFLAGS" , ldflags_env = " LDFLAGS" , &
205+ & fflags_env = " FFLAGS" , cflags_env = " CFLAGS" , cxxflags_env = " CXXFLAGS " , ldflags_env = " LDFLAGS" , &
205206 & fc_default = " gfortran" , cc_default = " " , ar_default = " " , flags_default = " " , &
206207 & cxx_env = " CXX" , cxx_default = " "
207208 type (error_t), allocatable :: error
@@ -251,6 +252,7 @@ subroutine get_command_line_settings(cmd_settings)
251252 ' --archiver "' // get_fpm_env(ar_env, ar_default)// ' "' // &
252253 ' --flag:: "' // get_fpm_env(fflags_env, flags_default)// ' "' // &
253254 ' --c-flag:: "' // get_fpm_env(cflags_env, flags_default)// ' "' // &
255+ ' --cxx-flag:: "' // get_fpm_env(cxxflags_env, flags_default)// ' "' // &
254256 ' --link-flag:: "' // get_fpm_env(ldflags_env, flags_default)// ' "'
255257
256258 ! now set subcommand-specific help text and process commandline
@@ -303,6 +305,7 @@ subroutine get_command_line_settings(cmd_settings)
303305 & archiver= archiver, &
304306 & flag= val_flag, &
305307 & cflag= val_cflag, &
308+ & cxxflag= val_cxxflag, &
306309 & ldflag= val_ldflag, &
307310 & example= lget(' example' ), &
308311 & list= lget(' list' ),&
@@ -332,6 +335,7 @@ subroutine get_command_line_settings(cmd_settings)
332335 & archiver= archiver, &
333336 & flag= val_flag, &
334337 & cflag= val_cflag, &
338+ & cxxflag= val_cxxflag, &
335339 & ldflag= val_ldflag, &
336340 & list= lget(' list' ),&
337341 & show_model= lget(' show-model' ),&
@@ -487,6 +491,7 @@ subroutine get_command_line_settings(cmd_settings)
487491 archiver= archiver, &
488492 flag= val_flag, &
489493 cflag= val_cflag, &
494+ cxxflag= val_cxxflag, &
490495 ldflag= val_ldflag, &
491496 no_rebuild= lget(' no-rebuild' ), &
492497 verbose= lget(' verbose' ))
@@ -543,6 +548,7 @@ subroutine get_command_line_settings(cmd_settings)
543548 & archiver= archiver, &
544549 & flag= val_flag, &
545550 & cflag= val_cflag, &
551+ & cxxflag= val_cxxflag, &
546552 & ldflag= val_ldflag, &
547553 & example= .false. , &
548554 & list= lget(' list' ), &
@@ -623,6 +629,7 @@ subroutine check_build_vals()
623629
624630 val_flag = " " // sget(' flag' )
625631 val_cflag = " " // sget(' c-flag' )
632+ val_cxxflag = " " // sget(' cxx-flag' )
626633 val_ldflag = " " // sget(' link-flag' )
627634 val_profile = sget(' profile' )
628635
0 commit comments