mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Merge pull request #6428 from theotherjimmy/many-source-export
Avoid incorrect config errors on export with many --sourcepull/6467/head
						commit
						c291b4ad32
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue