Skip to content

Commit 03422a9

Browse files
Extend show error/warning as Link
PR #6270 added a parameter which allows the user to decide in case of an error or warning to print the output as a link. This extension of this option also prints the ARM-GCC output in a link format.
1 parent 3bcc076 commit 03422a9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tools/notifier/term.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def print_notify(self, event):
8686
event['severity'] = event['severity'].title()
8787

8888
if PRINT_COMPILER_OUTPUT_AS_LINK:
89-
event['file'] = getcwd() + event['file'].strip('.')
89+
event['file'] = abspath(event['file'])
9090
return '[{severity}] {file}:{line}:{col}: {message}'.format(
9191
**event)
9292
else:

tools/toolchains/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import re
2020
import sys
21-
from os import stat, walk, getcwd, sep, remove
21+
from os import stat, walk, getcwd, sep, remove, path
2222
from copy import copy
2323
from time import time, sleep
2424
from shutil import copyfile
@@ -433,7 +433,7 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
433433
self.build_all = False
434434

435435
# Build output dir
436-
self.build_dir = build_dir
436+
self.build_dir = path.abspath(build_dir) if PRINT_COMPILER_OUTPUT_AS_LINK else build_dir
437437
self.timestamp = time()
438438

439439
# Number of concurrent build jobs. 0 means auto (based on host system cores)
@@ -987,6 +987,8 @@ def compile_command(self, source, object, includes):
987987
# Check dependencies
988988
_, ext = splitext(source)
989989
ext = ext.lower()
990+
991+
source = abspath(source) if PRINT_COMPILER_OUTPUT_AS_LINK else source
990992

991993
if ext == '.c' or ext == '.cpp':
992994
base, _ = splitext(object)

0 commit comments

Comments
 (0)