Skip to content

Add config data to build_lib in build_api.py #2423

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 11, 2016
Merged
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
10 changes: 10 additions & 0 deletions tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down