Skip to content

Commit f147f6f

Browse files
authored
Merge pull request #2471 from bridadan/copy-config-library
Copying JSON files to pick up config for built libraries
2 parents 030261f + 33672b4 commit f147f6f

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

tools/build_api.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717

1818
import re
1919
import tempfile
20-
2120
from types import ListType
2221
from shutil import rmtree
2322
from os.path import join, exists, basename, abspath, normpath
24-
from os import linesep
23+
from os import linesep, remove
2524
from time import time
2625

2726
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,
489488
dependencies_paths=None, options=None, name=None, clean=False,
490489
archive=True, notify=None, verbose=False, macros=None,
491490
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):
493493
""" Build a library
494494
495495
Positional arguments:
@@ -515,6 +515,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
515515
properties - UUUUHHHHH beats me
516516
extra_verbose - even more output!
517517
project_id - the name that goes in the report
518+
remove_config_header_file - delete config header file when done building
518519
"""
519520

520521
# Convert src_path to a list if needed
@@ -582,6 +583,8 @@ def build_library(src_paths, build_path, target, toolchain_name,
582583
toolchain.copy_files(resources.objects, build_path, resources=resources)
583584
toolchain.copy_files(resources.libraries, build_path,
584585
resources=resources)
586+
toolchain.copy_files(resources.json_files, build_path,
587+
resources=resources)
585588
if resources.linker_script:
586589
toolchain.copy_files(resources.linker_script, build_path,
587590
resources=resources)
@@ -598,6 +601,11 @@ def build_library(src_paths, build_path, target, toolchain_name,
598601
if archive:
599602
toolchain.build_library(objects, build_path, name)
600603

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+
601609
if report != None:
602610
end = time()
603611
cur_result["elapsed_time"] = end - start

tools/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@
177177
macros=options.macros,
178178
verbose=options.verbose,
179179
notify=notify,
180-
archive=False)
180+
archive=False,
181+
remove_config_header_file=True)
181182

182183
library_build_success = True
183184
except ToolException, e:

0 commit comments

Comments
 (0)