@@ -313,6 +313,12 @@ def process_sw_options(self, opts, flags_in):
313
313
item = opts ['ld' ]['flags' ][index ]
314
314
if not item .startswith ('-Wl,' ):
315
315
opts ['ld' ]['flags' ][index ] = '-Wl,' + item
316
+ # Assembler options
317
+ for as_def in self .as_defines :
318
+ if '=' in as_def :
319
+ opts ['as' ]['other' ] += ' --defsym ' + as_def
320
+ else :
321
+ opts ['as' ]['other' ] += ' --defsym ' + as_def + '=1'
316
322
317
323
def generate (self ):
318
324
"""
@@ -349,8 +355,9 @@ def generate(self):
349
355
self .cpp_defines = self .c_defines
350
356
print 'Symbols: {0}' .format (len (self .c_defines ))
351
357
352
- self .include_path = [self .filter_dot (s )
353
- for s in self .resources .inc_dirs ]
358
+ self .include_path = []
359
+ for s in self .resources .inc_dirs :
360
+ self .include_path .append ("../" + self .filter_dot (s ))
354
361
print ('Include folders: {0}' .format (len (self .include_path )))
355
362
356
363
self .compute_exclusions ()
@@ -362,6 +369,15 @@ def generate(self):
362
369
363
370
lib_dirs = [self .filter_dot (s ) for s in self .resources .lib_dirs ]
364
371
372
+ preproc_cmd = ""
373
+ # Hack for Windows. Build fails if command contains parentheses.
374
+ if ('(' in self .toolchain .preproc [0 ] or ')' in self .toolchain .preproc [0 ]) and self .toolchain .preproc [0 ][0 ] != "'" :
375
+ preproc_cmd = '"' + \
376
+ self .toolchain .preproc [0 ] + '"' + " " + \
377
+ " " .join (self .toolchain .preproc [1 :])
378
+ else :
379
+ preproc_cmd = " " .join (self .toolchain .preproc )
380
+
365
381
for id in ['debug' , 'release' ]:
366
382
opts = {}
367
383
opts ['common' ] = {}
@@ -407,13 +423,6 @@ def generate(self):
407
423
408
424
self .process_sw_options (opts , flags )
409
425
410
- if opts ['as' ]['usepreprocessor' ]:
411
- opts ['as' ]['other' ] += ' -x assembler-with-cpp'
412
- for as_def in self .as_defines :
413
- if '=' in as_def :
414
- opts ['as' ]['other' ] += ' -Wa,--defsym ' + as_def
415
- else :
416
- opts ['as' ]['other' ] += ' -Wa,--defsym ' + as_def + '=1'
417
426
opts ['c' ]['defines' ] = self .c_defines
418
427
opts ['cpp' ]['defines' ] = self .cpp_defines
419
428
@@ -447,7 +456,7 @@ def generate(self):
447
456
'libraries' : libraries ,
448
457
'board_name' : self .BOARDS [self .target .upper ()]['name' ],
449
458
'mcu_name' : self .BOARDS [self .target .upper ()]['mcuId' ],
450
- 'cpp_cmd' : " " . join ( self . toolchain . preproc ) ,
459
+ 'cpp_cmd' : preproc_cmd ,
451
460
'options' : options ,
452
461
# id property of 'u' will generate new random identifier every time
453
462
# when called.
0 commit comments