Skip to content

Commit c658aee

Browse files
the-horoibuclaw
authored andcommitted
Add -i option
Not fully compatible with dmd as dmd accepts an optional argument for the switch denoting which imports to also be compiled but since gdc-15 the common use case of plain -i is supported. Signed-off-by: Andrei Horodniceanu <[email protected]>
1 parent 377222b commit c658aee

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

dmd-script

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Usage:
133133
-Hffilename write 'header' file to filename
134134
--help|-h print help
135135
-Ipath where to look for imports
136+
-i include imported modules in the compilation
136137
-ignore ignore unsupported pragmas
137138
-inline do function inlining
138139
-Jpath where to look for string imports
@@ -378,6 +379,8 @@ while ( $arg_i < scalar(@ARGV) ) {
378379
exit 0;
379380
} elsif ($arg eq '-framework' ) {
380381
push @link_out, '-framework', $ARGV[$arg_i++];
382+
} elsif ( $arg eq '-i' ) {
383+
push @out, '-finclude-imports';
381384
} elsif ( $arg eq '-ignore' ) {
382385
push @out, '-fignore-unknown-pragmas';
383386
} elsif ( $arg =~ m/^-inline$/ ) {

dmd-script.1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ where to look for imports
6363
.I path
6464
is a ; separated list of paths. Multiple -I's can be used, and the paths are searched in the same order.
6565

66+
.IP -i
67+
Include imported modules in the compilation, as if they were given on the command line. When this option is enabled, all imported modules are compiled except those that are part of libphobos.
6668
.IP -ignore
6769
ignore unsupported pragmas
6870
.IP -inline

0 commit comments

Comments
 (0)