mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #8250 from theotherjimmy/fix-7723
Tools: Don't traceback on missing linker scriptpull/8495/head
commit
46d717cf18
|
@ -532,6 +532,8 @@ def build_project(src_paths, build_path, target, toolchain_name,
|
|||
# Change linker script if specified
|
||||
if linker_script is not None:
|
||||
resources.add_file_ref(linker_script, linker_script)
|
||||
if not resources.get_file_refs(FileType.LD_SCRIPT):
|
||||
raise NotSupportedException("No Linker Script found")
|
||||
|
||||
# Compile Sources
|
||||
objects = toolchain.compile_sources(resources, sorted(resources.get_file_paths(FileType.INC_DIR)))
|
||||
|
|
|
@ -622,8 +622,11 @@ class mbedToolchain:
|
|||
objects = sorted(set(r.get_file_paths(FileType.OBJECT)))
|
||||
config_file = ([self.config.app_config_location]
|
||||
if self.config.app_config_location else [])
|
||||
linker_script = [path for _, path in r.get_file_refs(FileType.LD_SCRIPT)
|
||||
if path.endswith(self.LINKER_EXT)][-1]
|
||||
try:
|
||||
linker_script = [path for _, path in r.get_file_refs(FileType.LD_SCRIPT)
|
||||
if path.endswith(self.LINKER_EXT)][-1]
|
||||
except IndexError:
|
||||
raise NotSupportedException("No linker script found")
|
||||
lib_dirs = r.get_file_paths(FileType.LIB_DIR)
|
||||
libraries = [l for l in r.get_file_paths(FileType.LIB)
|
||||
if l.endswith(self.LIBRARY_EXT)]
|
||||
|
|
Loading…
Reference in New Issue