File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
8
8
### Fixed
9
9
- Put ` vcs ` , ` vsim ` , and ` riviera ` defines in quotes.
10
10
11
+ ### Added
12
+ - Add flag for ` rtl ` target to files without target in script and sources.
13
+
11
14
## 0.28.1 - 2024-02-22
12
15
### Added
13
16
- Add ` flist-plus ` script format for file list with plusargs.
Original file line number Diff line number Diff line change @@ -188,6 +188,13 @@ pub fn new() -> Command {
188
188
. num_args ( 1 )
189
189
. value_parser ( value_parser ! ( String ) ) ,
190
190
)
191
+ . arg (
192
+ Arg :: new ( "assume_rtl" )
193
+ . long ( "assume-rtl" )
194
+ . help ( "Add the `rtl` target to any fileset without a target specification" )
195
+ . num_args ( 0 )
196
+ . action ( ArgAction :: SetTrue )
197
+ )
191
198
}
192
199
193
200
fn get_package_strings < I > ( packages : I ) -> IndexSet < String >
@@ -245,6 +252,11 @@ pub fn run(sess: &Session, matches: &ArgMatches) -> Result<()> {
245
252
)
246
253
} )
247
254
. unwrap_or_else ( || TargetSet :: new ( format_targets) ) ;
255
+
256
+ if matches. get_flag ( "assume_rtl" ) {
257
+ srcs = srcs. assign_target ( "rtl" . to_string ( ) ) ;
258
+ }
259
+
248
260
srcs = srcs
249
261
. filter_targets ( & targets)
250
262
. unwrap_or_else ( || SourceGroup {
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ pub fn new() -> Command {
62
62
. action ( ArgAction :: Append )
63
63
. value_parser ( value_parser ! ( String ) ) ,
64
64
)
65
+ . arg (
66
+ Arg :: new ( "assume_rtl" )
67
+ . long ( "assume-rtl" )
68
+ . help ( "Add the `rtl` target to any fileset without a target specification" )
69
+ . num_args ( 0 )
70
+ . action ( ArgAction :: SetTrue ) ,
71
+ )
65
72
. arg (
66
73
Arg :: new ( "raw" )
67
74
. long ( "raw" )
@@ -100,6 +107,11 @@ pub fn run(sess: &Session, matches: &ArgMatches) -> Result<()> {
100
107
. get_many :: < String > ( "target" )
101
108
. map ( TargetSet :: new)
102
109
. unwrap_or_else ( TargetSet :: empty) ;
110
+
111
+ if matches. get_flag ( "assume_rtl" ) {
112
+ srcs = srcs. assign_target ( "rtl" . to_string ( ) ) ;
113
+ }
114
+
103
115
srcs = srcs
104
116
. filter_targets ( & targets)
105
117
. unwrap_or_else ( || SourceGroup {
Original file line number Diff line number Diff line change @@ -107,6 +107,35 @@ impl<'ctx> SourceGroup<'ctx> {
107
107
)
108
108
}
109
109
110
+ /// Assigns target to SourceGroup without target
111
+ pub fn assign_target ( & self , target : String ) -> SourceGroup < ' ctx > {
112
+ let files = self
113
+ . files
114
+ . iter ( )
115
+ . filter_map ( |file| match * file {
116
+ SourceFile :: Group ( ref group) => Some ( group. assign_target ( target. clone ( ) ) )
117
+ . map ( |g| SourceFile :: Group ( Box :: new ( g) ) ) ,
118
+ ref other => Some ( other. clone ( ) ) ,
119
+ } )
120
+ . collect ( ) ;
121
+
122
+ SourceGroup {
123
+ package : self . package ,
124
+ independent : self . independent ,
125
+ target : if self . target . is_wildcard ( ) {
126
+ TargetSpec :: Name ( target)
127
+ } else {
128
+ self . target . clone ( )
129
+ } ,
130
+ include_dirs : self . include_dirs . clone ( ) ,
131
+ export_incdirs : self . export_incdirs . clone ( ) ,
132
+ defines : self . defines . clone ( ) ,
133
+ files,
134
+ dependencies : self . dependencies . clone ( ) ,
135
+ version : self . version . clone ( ) ,
136
+ }
137
+ }
138
+
110
139
/// Recursively get dependency names.
111
140
fn get_deps (
112
141
& self ,
You can’t perform that action at this time.
0 commit comments