Skip to content

Commit d471a4f

Browse files
author
Bogdan Marinescu
committed
Add config data to build_lib in build_api.py
`build_lib` wasn't aware of configuration data, so some of the source files that depends on configuration data fail to compile. This commit fixes that by making `build_lib` aware of configuration data.
1 parent 002865f commit d471a4f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/build_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,11 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False, clean
574574

575575
toolchain.info("Building library %s (%s, %s)" % (name.upper(), target.name, toolchain_name))
576576

577+
# Take into account the library configuration (MBED_CONFIG_FILE)
578+
config = Config(target)
579+
toolchain.config = config
580+
config.add_config_files([MBED_CONFIG_FILE])
581+
577582
# Scan Resources
578583
resources = []
579584
for src_path in src_paths:
@@ -596,6 +601,11 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False, clean
596601
if inc_dirs:
597602
dependencies_include_dir.extend(inc_dirs)
598603

604+
# Add other discovered configuration data to the configuration object
605+
for r in resources:
606+
config.load_resources(r)
607+
toolchain.set_config_data(toolchain.config.get_config_data())
608+
599609
# Create the desired build directory structure
600610
bin_path = join(build_path, toolchain.obj_path)
601611
mkdir(bin_path)

0 commit comments

Comments
 (0)