Merge pull request #2471 from bridadan/copy-config-library

Copying JSON files to pick up config for built libraries
pull/2557/head
Sam Grove 2016-08-26 09:38:35 -05:00 committed by GitHub
commit f147f6f3f2
2 changed files with 13 additions and 4 deletions

View File

@ -17,11 +17,10 @@ limitations under the License.
import re
import tempfile
from types import ListType
from shutil import rmtree
from os.path import join, exists, basename, abspath, normpath
from os import linesep
from os import linesep, remove
from time import time
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,
dependencies_paths=None, options=None, name=None, clean=False,
archive=True, notify=None, verbose=False, macros=None,
inc_dirs=None, jobs=1, silent=False, report=None,
properties=None, extra_verbose=False, project_id=None):
properties=None, extra_verbose=False, project_id=None,
remove_config_header_file=False):
""" Build a library
Positional arguments:
@ -515,6 +515,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
properties - UUUUHHHHH beats me
extra_verbose - even more output!
project_id - the name that goes in the report
remove_config_header_file - delete config header file when done building
"""
# Convert src_path to a list if needed
@ -582,6 +583,8 @@ def build_library(src_paths, build_path, target, toolchain_name,
toolchain.copy_files(resources.objects, build_path, resources=resources)
toolchain.copy_files(resources.libraries, build_path,
resources=resources)
toolchain.copy_files(resources.json_files, build_path,
resources=resources)
if resources.linker_script:
toolchain.copy_files(resources.linker_script, build_path,
resources=resources)
@ -598,6 +601,11 @@ def build_library(src_paths, build_path, target, toolchain_name,
if archive:
toolchain.build_library(objects, build_path, name)
if remove_config_header_file:
config_header_path = toolchain.get_config_header()
if config_header_path:
remove(config_header_path)
if report != None:
end = time()
cur_result["elapsed_time"] = end - start

View File

@ -177,7 +177,8 @@ if __name__ == '__main__':
macros=options.macros,
verbose=options.verbose,
notify=notify,
archive=False)
archive=False,
remove_config_header_file=True)
library_build_success = True
except ToolException, e: