summaryrefslogtreecommitdiff
path: root/lib/python/qmk/keymap.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/keymap.py')
-rw-r--r--lib/python/qmk/keymap.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index ac7951082e..2d5921e7a8 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -13,6 +13,7 @@ from pygments import lex
import qmk.path
from qmk.keyboard import find_keyboard_from_dir, rules_mk
+from qmk.errors import CppError
# The `keymap.c` template to use when a keyboard doesn't have its own
DEFAULT_KEYMAP_C = """#include QMK_KEYBOARD_H
@@ -372,7 +373,10 @@ def _c_preprocess(path, stdin=DEVNULL):
"""
cmd = ['cpp', str(path)] if path else ['cpp']
pre_processed_keymap = cli.run(cmd, stdin=stdin)
-
+ if 'fatal error' in pre_processed_keymap.stderr:
+ for line in pre_processed_keymap.stderr.split('\n'):
+ if 'fatal error' in line:
+ raise (CppError(line))
return pre_processed_keymap.stdout