Skip to content

Commit a25b9f3

Browse files
author
Cruz Monrreal
authored
Merge pull request #6999 from evva-sfw/feature/extend_error_warning_msg_as_link
Extend feature which displays errors/warnings as Link
2 parents 38f9519 + af1e482 commit a25b9f3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tools/notifier/term.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import re
2020
import sys
2121
from os import getcwd
22-
from os.path import basename
22+
from os.path import (basename, abspath)
2323

2424
from . import Notifier
2525
from ..settings import (PRINT_COMPILER_OUTPUT_AS_LINK,
@@ -87,7 +87,7 @@ def print_notify(self, event):
8787
event['severity'] = event['severity'].title()
8888

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

tools/toolchains/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
431431
self.build_all = False
432432

433433
# Build output dir
434-
self.build_dir = build_dir
434+
self.build_dir = abspath(build_dir) if PRINT_COMPILER_OUTPUT_AS_LINK else build_dir
435435
self.timestamp = time()
436436

437437
# Number of concurrent build jobs. 0 means auto (based on host system cores)
@@ -986,6 +986,8 @@ def compile_command(self, source, object, includes):
986986
_, ext = splitext(source)
987987
ext = ext.lower()
988988

989+
source = abspath(source) if PRINT_COMPILER_OUTPUT_AS_LINK else source
990+
989991
if ext == '.c' or ext == '.cpp':
990992
base, _ = splitext(object)
991993
dep_path = base + '.d'

0 commit comments

Comments
 (0)