17
17
18
18
import re
19
19
import tempfile
20
-
21
20
from types import ListType
22
21
from shutil import rmtree
23
22
from os .path import join , exists , basename , abspath , normpath
24
- from os import linesep
23
+ from os import linesep , remove
25
24
from time import time
26
25
27
26
from tools .utils import mkdir , run_cmd , run_cmd_ext , NotSupportedException ,\
@@ -489,7 +488,8 @@ def build_library(src_paths, build_path, target, toolchain_name,
489
488
dependencies_paths = None , options = None , name = None , clean = False ,
490
489
archive = True , notify = None , verbose = False , macros = None ,
491
490
inc_dirs = None , jobs = 1 , silent = False , report = None ,
492
- properties = None , extra_verbose = False , project_id = None ):
491
+ properties = None , extra_verbose = False , project_id = None ,
492
+ remove_config_header_file = False ):
493
493
""" Build a library
494
494
495
495
Positional arguments:
@@ -515,6 +515,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
515
515
properties - UUUUHHHHH beats me
516
516
extra_verbose - even more output!
517
517
project_id - the name that goes in the report
518
+ remove_config_header_file - delete config header file when done building
518
519
"""
519
520
520
521
# Convert src_path to a list if needed
@@ -582,6 +583,8 @@ def build_library(src_paths, build_path, target, toolchain_name,
582
583
toolchain .copy_files (resources .objects , build_path , resources = resources )
583
584
toolchain .copy_files (resources .libraries , build_path ,
584
585
resources = resources )
586
+ toolchain .copy_files (resources .json_files , build_path ,
587
+ resources = resources )
585
588
if resources .linker_script :
586
589
toolchain .copy_files (resources .linker_script , build_path ,
587
590
resources = resources )
@@ -598,6 +601,11 @@ def build_library(src_paths, build_path, target, toolchain_name,
598
601
if archive :
599
602
toolchain .build_library (objects , build_path , name )
600
603
604
+ if remove_config_header_file :
605
+ config_header_path = toolchain .get_config_header ()
606
+ if config_header_path :
607
+ remove (config_header_path )
608
+
601
609
if report != None :
602
610
end = time ()
603
611
cur_result ["elapsed_time" ] = end - start
0 commit comments