Merge pull request #2423 from ARMmbed/config_for_build_lib

Add config data to build_lib in build_api.py
pull/2430/merge
Bogdan Marinescu 2016-08-11 14:15:20 +01:00 committed by GitHub
commit f6f5c531cb
1 changed files with 10 additions and 0 deletions

View File

@ -574,6 +574,11 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False, clean
toolchain.info("Building library %s (%s, %s)" % (name.upper(), target.name, toolchain_name))
# Take into account the library configuration (MBED_CONFIG_FILE)
config = Config(target)
toolchain.config = config
config.add_config_files([MBED_CONFIG_FILE])
# Scan Resources
resources = []
for src_path in src_paths:
@ -596,6 +601,11 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False, clean
if inc_dirs:
dependencies_include_dir.extend(inc_dirs)
# Add other discovered configuration data to the configuration object
for r in resources:
config.load_resources(r)
toolchain.set_config_data(toolchain.config.get_config_data())
# Create the desired build directory structure
bin_path = join(build_path, toolchain.obj_path)
mkdir(bin_path)