@@ -163,18 +163,19 @@ def format_flags(self):
163
163
"," .join (filter (lambda f : f .startswith ("-D" ), flags ['asm_flags' ])))
164
164
flags ['asm_flags' ] = asm_flag_string
165
165
166
+ config_option = self .toolchain .get_config_option (
167
+ self .toolchain .get_config_header ())
166
168
c_flags = set (flags ['c_flags' ] + flags ['cxx_flags' ] + flags ['common_flags' ])
167
169
in_template = set (["--no_vla" , "--cpp" , "--c99" , "-std=gnu99" ,
168
- "-std=g++98" ] + self .toolchain .get_config_option (
169
- self .toolchain .get_config_header ()))
170
+ "-std=g++98" ] + config_option )
170
171
171
- valid_flag = lambda x : x not in in_template or not x .startswith ("-O" )
172
+ invalid_flag = lambda x : x in in_template or x .startswith ("-O" )
172
173
is_define = lambda s : s .startswith ("-D" )
173
174
174
175
flags ['c_flags' ] = " " .join (f .replace ('"' ,'\\ "' ) for f in c_flags
175
- if (valid_flag (f ) and not is_define (f )))
176
- flags ['c_flags' ] += " " . join ( self . toolchain . get_config_option (
177
- self . toolchain . get_config_header ()) )
176
+ if (not invalid_flag (f ) and not is_define (f )))
177
+ flags ['c_flags' ] += " "
178
+ flags [ 'c_flags' ] += " " . join ( config_option )
178
179
flags ['c_defines' ] = " " .join (f [2 :] for f in c_flags if is_define (f ))
179
180
flags ['ld_flags' ] = " " .join (set (flags ['ld_flags' ]))
180
181
return flags
0 commit comments