@@ -70,6 +70,7 @@ module fpm_command_line
70
70
logical :: list= .false.
71
71
logical :: show_model= .false.
72
72
logical :: build_tests= .false.
73
+ logical :: prune= .true.
73
74
character (len= :),allocatable :: compiler
74
75
character (len= :),allocatable :: c_compiler
75
76
character (len= :),allocatable :: archiver
@@ -122,6 +123,15 @@ module fpm_command_line
122
123
val_profile
123
124
124
125
! '12345678901234567890123456789012345678901234567890123456789012345678901234567890',&
126
+ character (len= 80 ), parameter :: help_text_build_common(* ) = [character (len= 80 ) :: &
127
+ ' --profile PROF Selects the compilation profile for the build. ' ,&
128
+ ' Currently available profiles are "release" for ' ,&
129
+ ' high optimization and "debug" for full debug options. ' ,&
130
+ ' If --flag is not specified the "debug" flags are the ' ,&
131
+ ' default. ' ,&
132
+ ' --no-prune Disable tree-shaking/pruning of unused module dependencies ' &
133
+ ]
134
+ ! '12345678901234567890123456789012345678901234567890123456789012345678901234567890',&
125
135
character (len= 80 ), parameter :: help_text_compiler(* ) = [character (len= 80 ) :: &
126
136
' --compiler NAME Specify a compiler name. The default is "gfortran" ' ,&
127
137
' unless set by the environment variable FPM_FC. ' ,&
@@ -219,6 +229,7 @@ subroutine get_command_line_settings(cmd_settings)
219
229
220
230
compiler_args = &
221
231
' --profile " "' // &
232
+ ' --no-prune F' // &
222
233
' --compiler "' // get_fpm_env(fc_env, fc_default)// ' "' // &
223
234
' --c-compiler "' // get_fpm_env(cc_env, cc_default)// ' "' // &
224
235
' --archiver "' // get_fpm_env(ar_env, ar_default)// ' "' // &
@@ -269,6 +280,7 @@ subroutine get_command_line_settings(cmd_settings)
269
280
cmd_settings= fpm_run_settings(&
270
281
& args= remaining,&
271
282
& profile= val_profile,&
283
+ & prune= .not. lget(' no-prune' ), &
272
284
& compiler= val_compiler, &
273
285
& c_compiler= c_compiler, &
274
286
& archiver= archiver, &
@@ -296,6 +308,7 @@ subroutine get_command_line_settings(cmd_settings)
296
308
allocate ( fpm_build_settings :: cmd_settings )
297
309
cmd_settings= fpm_build_settings( &
298
310
& profile= val_profile,&
311
+ & prune= .not. lget(' no-prune' ), &
299
312
& compiler= val_compiler, &
300
313
& c_compiler= c_compiler, &
301
314
& archiver= archiver, &
@@ -447,6 +460,7 @@ subroutine get_command_line_settings(cmd_settings)
447
460
install_settings = fpm_install_settings(&
448
461
list= lget(' list' ), &
449
462
profile= val_profile,&
463
+ prune= .not. lget(' no-prune' ), &
450
464
compiler= val_compiler, &
451
465
c_compiler= c_compiler, &
452
466
archiver= archiver, &
@@ -500,6 +514,7 @@ subroutine get_command_line_settings(cmd_settings)
500
514
cmd_settings= fpm_test_settings(&
501
515
& args= remaining, &
502
516
& profile= val_profile, &
517
+ & prune= .not. lget(' no-prune' ), &
503
518
& compiler= val_compiler, &
504
519
& c_compiler= c_compiler, &
505
520
& archiver= archiver, &
@@ -614,7 +629,7 @@ subroutine set_help()
614
629
help_list_dash = [character (len= 80 ) :: &
615
630
' ' , &
616
631
' build [--compiler COMPILER_NAME] [--profile PROF] [--flag FFLAGS] [--list] ' , &
617
- ' [--tests] ' , &
632
+ ' [--tests] [--no-prune] ' , &
618
633
' help [NAME(s)] ' , &
619
634
' new NAME [[--lib|--src] [--app] [--test] [--example]]| ' , &
620
635
' [--full|--bare][--backfill] ' , &
@@ -732,14 +747,15 @@ subroutine set_help()
732
747
' Their syntax is ' , &
733
748
' ' , &
734
749
' build [--profile PROF] [--flag FFLAGS] [--list] [--compiler COMPILER_NAME] ' , &
735
- ' [--tests] ' , &
750
+ ' [--tests] [--no-prune] ' , &
736
751
' new NAME [[--lib|--src] [--app] [--test] [--example]]| ' , &
737
752
' [--full|--bare][--backfill] ' , &
738
753
' update [NAME(s)] [--fetch-only] [--clean] ' , &
739
754
' run [[--target] NAME(s)] [--profile PROF] [--flag FFLAGS] [--list] [--all] ' , &
740
- ' [--example] [--runner "CMD"] [--compiler COMPILER_NAME] [-- ARGS] ' , &
755
+ ' [--example] [--runner "CMD"] [--compiler COMPILER_NAME] ' , &
756
+ ' [--no-prune] [-- ARGS] ' , &
741
757
' test [[--target] NAME(s)] [--profile PROF] [--flag FFLAGS] [--list] ' , &
742
- ' [--runner "CMD"] [--compiler COMPILER_NAME] [-- ARGS] ' , &
758
+ ' [--runner "CMD"] [--compiler COMPILER_NAME] [--no-prune] [-- ARGS] ' , &
743
759
' help [NAME(s)] ' , &
744
760
' list [--list] ' , &
745
761
' install [--profile PROF] [--flag FFLAGS] [--no-rebuild] [--prefix PATH] ' , &
@@ -748,11 +764,7 @@ subroutine set_help()
748
764
' SUBCOMMAND OPTIONS ' , &
749
765
' -C, --directory PATH' , &
750
766
' Change working directory to PATH before running any command' , &
751
- ' --profile PROF selects the compilation profile for the build.' ,&
752
- ' Currently available profiles are "release" for' ,&
753
- ' high optimization and "debug" for full debug options.' ,&
754
- ' If --flag is not specified the "debug" flags are the' ,&
755
- ' default. ' ,&
767
+ help_text_build_common, &
756
768
help_text_compiler, &
757
769
help_text_flag, &
758
770
' --list List candidates instead of building or running them. On ' , &
@@ -870,11 +882,7 @@ subroutine set_help()
870
882
' the special characters from shell expansion. ' , &
871
883
' --all Run all examples or applications. An alias for --target '' *'' . ' , &
872
884
' --example Run example programs instead of applications. ' , &
873
- ' --profile PROF selects the compilation profile for the build.' ,&
874
- ' Currently available profiles are "release" for' ,&
875
- ' high optimization and "debug" for full debug options.' ,&
876
- ' If --flag is not specified the "debug" flags are the' ,&
877
- ' default. ' ,&
885
+ help_text_build_common, &
878
886
help_text_compiler, &
879
887
help_text_flag, &
880
888
' --runner CMD A command to prefix the program execution paths with. ' , &
@@ -941,11 +949,7 @@ subroutine set_help()
941
949
' specified in the "fpm.toml" file. ' , &
942
950
' ' , &
943
951
' OPTIONS ' , &
944
- ' --profile PROF selects the compilation profile for the build.' ,&
945
- ' Currently available profiles are "release" for' ,&
946
- ' high optimization and "debug" for full debug options.' ,&
947
- ' If --flag is not specified the "debug" flags are the' ,&
948
- ' default. ' ,&
952
+ help_text_build_common,&
949
953
help_text_compiler, &
950
954
help_text_flag, &
951
955
' --list list candidates instead of building or running them ' , &
@@ -1118,11 +1122,7 @@ subroutine set_help()
1118
1122
' any single character and "*" represents any string. ' , &
1119
1123
' Note The glob string normally needs quoted to ' , &
1120
1124
' protect the special characters from shell expansion.' , &
1121
- ' --profile PROF selects the compilation profile for the build.' ,&
1122
- ' Currently available profiles are "release" for' ,&
1123
- ' high optimization and "debug" for full debug options.' ,&
1124
- ' If --flag is not specified the "debug" flags are the' ,&
1125
- ' default. ' ,&
1125
+ help_text_build_common,&
1126
1126
help_text_compiler, &
1127
1127
help_text_flag, &
1128
1128
' --runner CMD A command to prefix the program execution paths with. ' , &
@@ -1187,11 +1187,7 @@ subroutine set_help()
1187
1187
' OPTIONS' , &
1188
1188
' --list list all installable targets for this project,' , &
1189
1189
' but do not install any of them' , &
1190
- ' --profile PROF selects the compilation profile for the build.' ,&
1191
- ' Currently available profiles are "release" for' ,&
1192
- ' high optimization and "debug" for full debug options.' ,&
1193
- ' If --flag is not specified the "debug" flags are the' ,&
1194
- ' default. ' ,&
1190
+ help_text_build_common,&
1195
1191
help_text_flag, &
1196
1192
' --no-rebuild do not rebuild project before installation' , &
1197
1193
' --prefix DIR path to installation directory (requires write access),' , &
0 commit comments