From 3a13c2120a9e3d897e05923c68efa542f3b3efc7 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 1 Feb 2024 15:45:58 +0000 Subject: [PATCH] Ensure LTO is enabled as a `info.json` build config option (#22932) * feature.lto -> build.lto * keymaps too --- data/schemas/keyboard.jsonschema | 4 ++-- keyboards/acheron/themis/87h/info.json | 4 +++- keyboards/acheron/themis/87htsc/info.json | 4 +++- keyboards/acheron/themis/88htsc/info.json | 4 +++- keyboards/clueboard/card/info.json | 1 - keyboards/crkbd/info.json | 1 - keyboards/dark/magnum_ergo_1/info.json | 4 +++- keyboards/fancytech/fancyalice66/info.json | 4 +++- keyboards/hotdox76v2/info.json | 1 - keyboards/kbdfans/kbdpad/mk3/info.json | 1 - keyboards/keychron/q1v1/info.json | 4 +++- keyboards/mode/m256wh/info.json | 4 +++- keyboards/mode/m256ws/info.json | 4 +++- keyboards/moondrop/dash75/info.json | 6 ++++-- keyboards/moondrop/dash75/keymaps/via/keymap.json | 3 +-- keyboards/pauperboards/brick/info.json | 3 +-- keyboards/quadrum/delta/info.json | 4 +++- keyboards/quokka/info.json | 1 - keyboards/smithrune/magnus/m75h/info.json | 4 +++- keyboards/smithrune/magnus/m75s/info.json | 4 +++- keyboards/teleport/native/info.json | 6 ++++-- keyboards/thevankeyboards/minivan/keymaps/via/keymap.json | 6 ++++-- lib/python/qmk/info.py | 3 +++ 23 files changed, 52 insertions(+), 28 deletions(-) diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 4836cf1fcae..d953079659c 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -314,8 +314,8 @@ }, "features": { "$ref": "qmk.definitions.v1#/boolean_array", - "propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" } - + "propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }, + "not": { "required": [ "lto" ] } }, "indicators": { "type": "object", diff --git a/keyboards/acheron/themis/87h/info.json b/keyboards/acheron/themis/87h/info.json index 0ef52a61a05..a7bfb899978 100644 --- a/keyboards/acheron/themis/87h/info.json +++ b/keyboards/acheron/themis/87h/info.json @@ -8,9 +8,11 @@ "cols": ["A8" ,"C9" ,"C8" ,"B14","B12","B10","B1" ,"B0" ,"A7" ,"A6" ,"A5" ,"A4" ,"C5" ,"C7" ,"B3" ,"A2" ,"C12","D2" ], "rows": ["A15","A10","C6" ,"C4" ,"A3" ,"A1" ,"C11","C10","B4"] }, + "build": { + "lto": true + }, "features": { "bootmagic": true, - "lto": true, "mousekey": true, "extrakey": true, "console": false, diff --git a/keyboards/acheron/themis/87htsc/info.json b/keyboards/acheron/themis/87htsc/info.json index 75c680d2a42..5f388147892 100644 --- a/keyboards/acheron/themis/87htsc/info.json +++ b/keyboards/acheron/themis/87htsc/info.json @@ -8,9 +8,11 @@ "cols": ["A8" ,"C9" ,"C8" ,"B14","B12","B10","B1" ,"B0" ,"A7" ,"A6" ,"A5" ,"A4" ,"C5" ,"C7" ,"B3" ,"A2" ,"C12","D2" ], "rows": ["A15","A10","C6" ,"C4" ,"A3" ,"A1" ,"C11","C10","B4"] }, + "build": { + "lto": true + }, "features": { "bootmagic": true, - "lto": true, "mousekey": true, "extrakey": true, "console": false, diff --git a/keyboards/acheron/themis/88htsc/info.json b/keyboards/acheron/themis/88htsc/info.json index 8726642c0c4..20b3d38828a 100644 --- a/keyboards/acheron/themis/88htsc/info.json +++ b/keyboards/acheron/themis/88htsc/info.json @@ -8,9 +8,11 @@ "cols": ["A8" ,"C9" ,"C8" ,"B14","B12","B10","B1" ,"B0" ,"A7" ,"A6" ,"A5" ,"A4" ,"C5" ,"C7" ,"B3" ,"A2" ,"C12","D2" ], "rows": ["A15","A10","C6" ,"C4" ,"A3" ,"A1" ,"C11","C10","B4"] }, + "build": { + "lto": true + }, "features": { "bootmagic": true, - "lto": true, "mousekey": true, "extrakey": true, "console": false, diff --git a/keyboards/clueboard/card/info.json b/keyboards/clueboard/card/info.json index 98c9f4d5f17..7799110ba6d 100644 --- a/keyboards/clueboard/card/info.json +++ b/keyboards/clueboard/card/info.json @@ -14,7 +14,6 @@ "command": false, "console": true, "extrakey": true, - "lto": true, "midi": false, "mousekey": true, "nkro": false, diff --git a/keyboards/crkbd/info.json b/keyboards/crkbd/info.json index fa9abc574e6..880cbccc29e 100644 --- a/keyboards/crkbd/info.json +++ b/keyboards/crkbd/info.json @@ -14,7 +14,6 @@ "features": { "bootmagic": true, "extrakey": true, - "lto": true, "mousekey": true, "nkro": true, "oled": true diff --git a/keyboards/dark/magnum_ergo_1/info.json b/keyboards/dark/magnum_ergo_1/info.json index a213d92fd56..6ed39084797 100644 --- a/keyboards/dark/magnum_ergo_1/info.json +++ b/keyboards/dark/magnum_ergo_1/info.json @@ -8,6 +8,9 @@ "pid": "0x4D45", "device_version": "0.0.1" }, + "build": { + "lto": true + }, "features": { "audio": false, "backlight": true, @@ -16,7 +19,6 @@ "console": false, "encoder": false, "extrakey": true, - "lto": true, "mousekey": false, "nkro": true, "rgblight": false diff --git a/keyboards/fancytech/fancyalice66/info.json b/keyboards/fancytech/fancyalice66/info.json index 21c89849fde..b2e219c1c90 100644 --- a/keyboards/fancytech/fancyalice66/info.json +++ b/keyboards/fancytech/fancyalice66/info.json @@ -9,11 +9,13 @@ {"pin_a": "F0", "pin_b": "F1", "resolution": 2} ] }, + "build": { + "lto": true + }, "features": { "bootmagic": true, "encoder": false, "extrakey": true, - "lto": true, "mousekey": true, "nkro": true, "rgb_matrix": true diff --git a/keyboards/hotdox76v2/info.json b/keyboards/hotdox76v2/info.json index 2270d332739..30fd71f62a6 100644 --- a/keyboards/hotdox76v2/info.json +++ b/keyboards/hotdox76v2/info.json @@ -11,7 +11,6 @@ "extrakey": true, "mousekey": true, "nkro": true, - "lto": true, "oled": true, "rgb_matrix": true }, diff --git a/keyboards/kbdfans/kbdpad/mk3/info.json b/keyboards/kbdfans/kbdpad/mk3/info.json index 56c7b809770..735dd3e4ef4 100644 --- a/keyboards/kbdfans/kbdpad/mk3/info.json +++ b/keyboards/kbdfans/kbdpad/mk3/info.json @@ -9,7 +9,6 @@ "command": false, "console": false, "extrakey": true, - "lto": true, "mousekey": true, "nkro": true, "rgb_matrix": true diff --git a/keyboards/keychron/q1v1/info.json b/keyboards/keychron/q1v1/info.json index 26c846927bd..00416872693 100644 --- a/keyboards/keychron/q1v1/info.json +++ b/keyboards/keychron/q1v1/info.json @@ -4,13 +4,15 @@ "maintainer": "lalalademaxiya1", "bootloader": "atmel-dfu", "diode_direction": "ROW2COL", + "build": { + "lto": true + }, "features": { "bootmagic": true, "command": false, "console": false, "dip_switch": true, "extrakey": true, - "lto": true, "mousekey": true, "nkro": true, "rgb_matrix": true diff --git a/keyboards/mode/m256wh/info.json b/keyboards/mode/m256wh/info.json index 6caaa754ed3..bbd3c17e97b 100644 --- a/keyboards/mode/m256wh/info.json +++ b/keyboards/mode/m256wh/info.json @@ -4,9 +4,11 @@ "maintainer": "Gondolindrim", "bootloader": "stm32-dfu", "diode_direction": "COL2ROW", + "build": { + "lto": true + }, "features": { "extrakey": true, - "lto": true, "mousekey": true, "nkro": true, "rgblight": true diff --git a/keyboards/mode/m256ws/info.json b/keyboards/mode/m256ws/info.json index 6a36d4af8e4..820ed536c21 100644 --- a/keyboards/mode/m256ws/info.json +++ b/keyboards/mode/m256ws/info.json @@ -4,12 +4,14 @@ "maintainer": "Gondolindrim", "bootloader": "stm32-dfu", "diode_direction": "COL2ROW", + "build": { + "lto": true + }, "features": { "bootmagic": true, "command": false, "console": false, "extrakey": true, - "lto": true, "mousekey": true, "nkro": true, "rgblight": true diff --git a/keyboards/moondrop/dash75/info.json b/keyboards/moondrop/dash75/info.json index 13e28fb3254..59f956815ea 100644 --- a/keyboards/moondrop/dash75/info.json +++ b/keyboards/moondrop/dash75/info.json @@ -3,14 +3,16 @@ "keyboard_name": "Dash 75", "maintainer": "vinorodrigues", "bootloader": "atmel-dfu", + "build": { + "lto": true + }, "features": { "bootmagic": true, "command": false, "console": false, "extrakey": true, "mousekey": true, - "nkro": false, - "lto": true + "nkro": false }, "diode_direction": "COL2ROW", "matrix_pins": { diff --git a/keyboards/moondrop/dash75/keymaps/via/keymap.json b/keyboards/moondrop/dash75/keymaps/via/keymap.json index d811aaa7803..91faa45808c 100644 --- a/keyboards/moondrop/dash75/keymaps/via/keymap.json +++ b/keyboards/moondrop/dash75/keymaps/via/keymap.json @@ -7,8 +7,7 @@ "author": "vinorodrigues", "config": { "features": { - "via": true, - "lto": true + "via": true } }, "layers": [ diff --git a/keyboards/pauperboards/brick/info.json b/keyboards/pauperboards/brick/info.json index 112a84ff1ae..8ebe32ded41 100644 --- a/keyboards/pauperboards/brick/info.json +++ b/keyboards/pauperboards/brick/info.json @@ -23,8 +23,7 @@ "mousekey": true, "nkro": true, "encoder": true, - "rgblight": true, - "lto": true + "rgblight": true }, "build": { "lto": true diff --git a/keyboards/quadrum/delta/info.json b/keyboards/quadrum/delta/info.json index 118a2dcbd6b..bfdc0afd628 100644 --- a/keyboards/quadrum/delta/info.json +++ b/keyboards/quadrum/delta/info.json @@ -4,6 +4,9 @@ "maintainer": "Sleepdealr", "bootloader": "atmel-dfu", "diode_direction": "COL2ROW", + "build": { + "lto": true + }, "features": { "bootmagic": true, "command": false, @@ -11,7 +14,6 @@ "extrakey": true, "mousekey": true, "nkro": true, - "lto": true, "encoder": true }, "matrix_pins": { diff --git a/keyboards/quokka/info.json b/keyboards/quokka/info.json index ed951ff0b2d..0c34b0ee65f 100644 --- a/keyboards/quokka/info.json +++ b/keyboards/quokka/info.json @@ -10,7 +10,6 @@ "features": { "audio": true, "extrakey": true, - "lto": true, "oled": true, "rgb_matrix": true }, diff --git a/keyboards/smithrune/magnus/m75h/info.json b/keyboards/smithrune/magnus/m75h/info.json index 0592d2a7a6d..9b120a186e6 100644 --- a/keyboards/smithrune/magnus/m75h/info.json +++ b/keyboards/smithrune/magnus/m75h/info.json @@ -8,6 +8,9 @@ "pid": "0x1676", "device_version": "0.0.1" }, + "build": { + "lto": true + }, "features": { "audio": false, "backlight": false, @@ -16,7 +19,6 @@ "console": false, "encoder": false, "extrakey": true, - "lto": true, "mousekey": true, "nkro": true, "rgblight": true diff --git a/keyboards/smithrune/magnus/m75s/info.json b/keyboards/smithrune/magnus/m75s/info.json index da2f4e3eff8..56f7a06b04f 100644 --- a/keyboards/smithrune/magnus/m75s/info.json +++ b/keyboards/smithrune/magnus/m75s/info.json @@ -8,6 +8,9 @@ "pid": "0x1675", "device_version": "0.0.1" }, + "build": { + "lto": true + }, "features": { "audio": false, "backlight": true, @@ -16,7 +19,6 @@ "console": false, "encoder": false, "extrakey": true, - "lto": true, "mousekey": true, "nkro": true, "rgblight": true diff --git a/keyboards/teleport/native/info.json b/keyboards/teleport/native/info.json index eaf9118ff98..3cd857a55dc 100644 --- a/keyboards/teleport/native/info.json +++ b/keyboards/teleport/native/info.json @@ -29,14 +29,16 @@ "led_flush_limit": 32, "sleep": true }, + "build": { + "lto": true + }, "features": { "bootmagic": true, "command": false, "console": false, "extrakey": true, "mousekey": true, - "nkro": true, - "lto": true + "nkro": true }, "diode_direction": "ROW2COL", "matrix_pins": { diff --git a/keyboards/thevankeyboards/minivan/keymaps/via/keymap.json b/keyboards/thevankeyboards/minivan/keymaps/via/keymap.json index 54ceb5c342d..bff872dee84 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/via/keymap.json +++ b/keyboards/thevankeyboards/minivan/keymaps/via/keymap.json @@ -9,10 +9,12 @@ ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"] ], "config": { - "features": { - "via": true, + "build": { "lto": true }, + "features": { + "via": true + }, "dynamic_keymap": { "layer_count": 4 } diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 4ef12bea713..13588abdb85 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -233,6 +233,9 @@ def _extract_features(info_data, rules): key = '_'.join(key.split('_')[:-1]).lower() value = True if value.lower() in true_values else False if value.lower() in false_values else value + if key in ['lto']: + continue + if 'config_h_features' not in info_data: info_data['config_h_features'] = {}