summaryrefslogtreecommitdiff
path: root/builddefs
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-07-05 08:58:35 +1000
committerGitHub <noreply@github.com>2022-07-05 08:58:35 +1000
commit0e5d67145a649480fd49a72712997feb6303a471 (patch)
treee8d4090768c2612fa77c3d508bc7af998b5d96b0 /builddefs
parent5cad58dfa960c9463ee5835de131b8fcb2d446e4 (diff)
downloadqmk_firmware-0e5d67145a649480fd49a72712997feb6303a471.tar.gz
qmk_firmware-0e5d67145a649480fd49a72712997feb6303a471.zip
Allow for `keymaps` array to be implemented in a file other than `$(KEYMAP_C)` (#17559)
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/build_keyboard.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk
index b5616a438f..fe95dcaf15 100644
--- a/builddefs/build_keyboard.mk
+++ b/builddefs/build_keyboard.mk
@@ -400,6 +400,12 @@ endif
OPT_DEFS += -DKEYMAP_C=\"$(KEYMAP_C)\"
+# If a keymap or userspace places their keymap array in another file instead, allow for it to be included
+# !!NOTE!! -- For this to work, the source file cannot be part of $(SRC), so users should not add it via `SRC += <file>`
+ifneq ($(strip $(INTROSPECTION_KEYMAP_C)),)
+OPT_DEFS += -DINTROSPECTION_KEYMAP_C=\"$(strip $(INTROSPECTION_KEYMAP_C))\"
+endif
+
# project specific files
SRC += \
$(KEYBOARD_SRC) \