Skip to content

Copying JSON files to pick up config for built libraries #2471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@

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,\
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@
macros=options.macros,
verbose=options.verbose,
notify=notify,
archive=False)
archive=False,
remove_config_header_file=True)

library_build_success = True
except ToolException, e:
Expand Down