File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -112,10 +112,10 @@ def flags(self):
112
112
flags ['cxx_flags' ] += c_defines
113
113
config_header = self .config_header_ref
114
114
if config_header :
115
- flags ['c_flags' ] += self .toolchain .get_config_option (
116
- config_header .name )
117
- flags ['cxx_flags' ] += self .toolchain .get_config_option (
115
+ config_option = self .toolchain .get_config_option (
118
116
config_header .name )
117
+ flags ['c_flags' ] += config_option
118
+ flags ['cxx_flags' ] += config_option
119
119
return flags
120
120
121
121
@property
Original file line number Diff line number Diff line change @@ -178,8 +178,8 @@ def format_flags(self):
178
178
"," .join (filter (lambda f : f .startswith ("-D" ), flags ['asm_flags' ])))
179
179
flags ['asm_flags' ] = asm_flag_string
180
180
181
- config_option = self .toolchain . get_config_option (
182
- self .toolchain .get_config_header () )
181
+ config_header = self .config_header_ref
182
+ config_option = self .toolchain .get_config_option ( config_header . name )
183
183
c_flags = set (
184
184
flags ['c_flags' ] + flags ['cxx_flags' ] + flags ['common_flags' ]
185
185
)
@@ -189,17 +189,18 @@ def format_flags(self):
189
189
190
190
def valid_flag (x ):
191
191
return (
192
- x not in in_template or
193
- not x .startswith ("-O" ) or
194
- not x .startswith ("-std" ) or
192
+ x not in in_template and
193
+ not x .startswith ("-O" ) and
194
+ not x .startswith ("-std" ) and
195
195
not x .startswith ("-D" )
196
196
)
197
197
198
198
def is_define (s ):
199
199
return s .startswith ("-D" ) and "(" not in s
200
200
201
- flags ['c_flags' ] = " " .join (f .replace ('"' , '\\ "' ) for f in c_flags
202
- if (valid_flag (f ) and not is_define (f )))
201
+ flags ['c_flags' ] = " " .join (
202
+ f .replace ('"' , '\\ "' ) for f in c_flags if valid_flag (f )
203
+ )
203
204
flags ['c_flags' ] += " "
204
205
flags ['c_flags' ] += " " .join (config_option )
205
206
flags ['c_defines' ] = " " .join (f [2 :] for f in c_flags if is_define (f ))
You can’t perform that action at this time.
0 commit comments