Skip to content

Commit 0f7e900

Browse files
committed
Pass app config to get config
This corrects a bug which would manifest as --app-config not having much of an affect on test builds (not the first libary bulid)
1 parent 4e66f21 commit 0f7e900

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

tools/build_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def add_result_to_report(report, result):
120120
result_wrap = {0: result}
121121
report[target][toolchain][id_name].append(result_wrap)
122122

123-
def get_config(src_paths, target, toolchain_name):
123+
def get_config(src_paths, target, toolchain_name, app_config=None):
124124
"""Get the configuration object for a target-toolchain combination
125125
126126
Positional arguments:
@@ -133,7 +133,8 @@ def get_config(src_paths, target, toolchain_name):
133133
src_paths = [src_paths]
134134

135135
# Pass all params to the unified prepare_resources()
136-
toolchain = prepare_toolchain(src_paths, None, target, toolchain_name)
136+
toolchain = prepare_toolchain(src_paths, None, target, toolchain_name,
137+
app_config=app_config)
137138

138139
# Scan src_path for config files
139140
resources = toolchain.scan_resources(src_paths[0])

tools/get_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333

3434
if __name__ == '__main__':
3535
# Parse Options
36-
parser = get_default_options_parser(add_clean=False, add_options=False)
36+
parser = get_default_options_parser(add_clean=False, add_options=False,
37+
add_app_config=True)
3738
parser.add_argument(
3839
"--source", dest="source_dir", type=argparse_filestring_type,
3940
required=True, default=[], help="The source (input) directory",
@@ -61,7 +62,7 @@
6162

6263
try:
6364
params, macros, features = get_config(
64-
options.source_dir, target, toolchain)
65+
options.source_dir, target, toolchain, app_config=options.app_config)
6566
if not params and not macros:
6667
print("No configuration data available.")
6768
sys.exit(0)

tools/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2220,7 +2220,7 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
22202220
base_path = norm_relative_path(build_path, execution_directory)
22212221

22222222
target_name = target.name if isinstance(target, Target) else target
2223-
cfg, _, _ = get_config(base_source_paths, target_name, toolchain_name)
2223+
cfg, _, _ = get_config(base_source_paths, target_name, toolchain_name, app_config=app_config)
22242224

22252225
baud_rate = 9600
22262226
if 'platform.stdio-baud-rate' in cfg:

0 commit comments

Comments
 (0)