Avoid incorrect config errors on export

pull/6428/head
Jimmy Brisson 2018-03-22 11:44:41 -05:00
parent 7b325f30a0
commit cd31272d4b
1 changed files with 10 additions and 5 deletions

View File

@ -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, ".")
@ -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