Skip to content

Avoid incorrect config errors on export with many --source #6428

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
Mar 26, 2018
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
15 changes: 10 additions & 5 deletions tools/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,11 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
name = basename(normpath(abspath(src_paths[0])))

# Call unified scan_resources
resource_dict = {loc: scan_resources(path, toolchain, inc_dirs=inc_dirs, collect_ignores=True)
resource_dict = {loc: sum((toolchain.scan_resources(p, collect_ignores=True)
for p in path),
Resources())
for loc, path in src_paths.items()}
resources = Resources()
toolchain.build_dir = export_path
config_header = toolchain.get_config_header()
resources.headers.append(config_header)
resources.file_basepath[config_header] = dirname(config_header)

if zip_proj:
subtract_basepath(resources, ".")
Expand All @@ -333,6 +331,13 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
for _, res in resource_dict.items():
resources.add(res)

toolchain.build_dir = export_path
toolchain.config.load_resources(resources)
toolchain.set_config_data(toolchain.config.get_config_data())
config_header = toolchain.get_config_header()
resources.headers.append(config_header)
resources.file_basepath[config_header] = dirname(config_header)

# Change linker script if specified
if linker_script is not None:
resources.linker_script = linker_script
Expand Down