Skip to content

Commit

Permalink
Ensure LTO is enabled as a info.json build config option (#22932)
Browse files Browse the repository at this point in the history
* feature.lto -> build.lto

* keymaps too
  • Loading branch information
zvecr authored Feb 1, 2024
1 parent 7902051 commit 3a13c21
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 28 deletions.
4 changes: 2 additions & 2 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion keyboards/acheron/themis/87h/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion keyboards/acheron/themis/87htsc/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion keyboards/acheron/themis/88htsc/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion keyboards/clueboard/card/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"command": false,
"console": true,
"extrakey": true,
"lto": true,
"midi": false,
"mousekey": true,
"nkro": false,
Expand Down
1 change: 0 additions & 1 deletion keyboards/crkbd/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"features": {
"bootmagic": true,
"extrakey": true,
"lto": true,
"mousekey": true,
"nkro": true,
"oled": true
Expand Down
4 changes: 3 additions & 1 deletion keyboards/dark/magnum_ergo_1/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"pid": "0x4D45",
"device_version": "0.0.1"
},
"build": {
"lto": true
},
"features": {
"audio": false,
"backlight": true,
Expand All @@ -16,7 +19,6 @@
"console": false,
"encoder": false,
"extrakey": true,
"lto": true,
"mousekey": false,
"nkro": true,
"rgblight": false
Expand Down
4 changes: 3 additions & 1 deletion keyboards/fancytech/fancyalice66/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion keyboards/hotdox76v2/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"extrakey": true,
"mousekey": true,
"nkro": true,
"lto": true,
"oled": true,
"rgb_matrix": true
},
Expand Down
1 change: 0 additions & 1 deletion keyboards/kbdfans/kbdpad/mk3/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"command": false,
"console": false,
"extrakey": true,
"lto": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true
Expand Down
4 changes: 3 additions & 1 deletion keyboards/keychron/q1v1/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion keyboards/mode/m256wh/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion keyboards/mode/m256ws/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions keyboards/moondrop/dash75/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 1 addition & 2 deletions keyboards/moondrop/dash75/keymaps/via/keymap.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"author": "vinorodrigues",
"config": {
"features": {
"via": true,
"lto": true
"via": true
}
},
"layers": [
Expand Down
3 changes: 1 addition & 2 deletions keyboards/pauperboards/brick/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"mousekey": true,
"nkro": true,
"encoder": true,
"rgblight": true,
"lto": true
"rgblight": true
},
"build": {
"lto": true
Expand Down
4 changes: 3 additions & 1 deletion keyboards/quadrum/delta/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
"maintainer": "Sleepdealr",
"bootloader": "atmel-dfu",
"diode_direction": "COL2ROW",
"build": {
"lto": true
},
"features": {
"bootmagic": true,
"command": false,
"console": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"lto": true,
"encoder": true
},
"matrix_pins": {
Expand Down
1 change: 0 additions & 1 deletion keyboards/quokka/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"features": {
"audio": true,
"extrakey": true,
"lto": true,
"oled": true,
"rgb_matrix": true
},
Expand Down
4 changes: 3 additions & 1 deletion keyboards/smithrune/magnus/m75h/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"pid": "0x1676",
"device_version": "0.0.1"
},
"build": {
"lto": true
},
"features": {
"audio": false,
"backlight": false,
Expand All @@ -16,7 +19,6 @@
"console": false,
"encoder": false,
"extrakey": true,
"lto": true,
"mousekey": true,
"nkro": true,
"rgblight": true
Expand Down
4 changes: 3 additions & 1 deletion keyboards/smithrune/magnus/m75s/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"pid": "0x1675",
"device_version": "0.0.1"
},
"build": {
"lto": true
},
"features": {
"audio": false,
"backlight": true,
Expand All @@ -16,7 +19,6 @@
"console": false,
"encoder": false,
"extrakey": true,
"lto": true,
"mousekey": true,
"nkro": true,
"rgblight": true
Expand Down
6 changes: 4 additions & 2 deletions keyboards/teleport/native/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 4 additions & 2 deletions keyboards/thevankeyboards/minivan/keymaps/via/keymap.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions lib/python/qmk/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = {}

Expand Down

0 comments on commit 3a13c21

Please sign in to comment.