1
1
import os
2
- from os .path import sep , normpath , join , exists
2
+ from os .path import sep , normpath , join , exists , relpath
3
3
import ntpath
4
4
import copy
5
5
from collections import namedtuple
@@ -163,13 +163,16 @@ 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
+ config_header = self .toolchain .get_config_header ()
167
+ config_header = relpath (config_header ,
168
+ self .resources .file_basepath [config_header ])
169
+ config_option = self .toolchain .get_config_option (config_header )
168
170
c_flags = set (flags ['c_flags' ] + flags ['cxx_flags' ] + flags ['common_flags' ])
169
- in_template = set (["--no_vla" , "--cpp" , "--c99" , "-std=gnu99" ,
170
- "-std=g++98" ] + config_option )
171
+ in_template = set (["--no_vla" , "--cpp" , "--c99" ] + config_option )
171
172
172
- invalid_flag = lambda x : x in in_template or x .startswith ("-O" )
173
+ invalid_flag = lambda x : (x in in_template or
174
+ x .startswith ("-O" ) or
175
+ x .startswith ("-std" ))
173
176
is_define = lambda s : s .startswith ("-D" )
174
177
175
178
flags ['c_flags' ] = " " .join (f .replace ('"' ,'\\ "' ) for f in c_flags
@@ -178,6 +181,7 @@ def format_flags(self):
178
181
flags ['c_flags' ] += " " .join (config_option )
179
182
flags ['c_defines' ] = " " .join (f [2 :] for f in c_flags if is_define (f ))
180
183
flags ['ld_flags' ] = " " .join (set (flags ['ld_flags' ]))
184
+ print (flags ['c_flags' ])
181
185
return flags
182
186
183
187
def format_src (self , srcs ):
0 commit comments