Skip to content

Commit

Permalink
[Core] Add short form LTO_ENABLE (#7259)
Browse files Browse the repository at this point in the history
For drashna's sanity's sake
  • Loading branch information
drashna authored and noroadsleft committed Nov 4, 2019
1 parent a836c85 commit 29630e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ Use these to enable or disable building certain features. The more you have enab
* `NO_USB_STARTUP_CHECK`
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
* `LINK_TIME_OPTIMIZATION_ENABLE`
= Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
* Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticeable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
* Alternatively, you can use `LTO_ENABLE` instead of `LINK_TIME_OPTIMIZATION_ENABLE`.

## USB Endpoint Limitations

Expand Down
3 changes: 3 additions & 0 deletions tmk_core/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
endif

ifeq ($(strip $(LTO_ENABLE)), yes)
LINK_TIME_OPTIMIZATION_ENABLE = yes
endif

ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes)
EXTRAFLAGS += -flto
Expand Down

0 comments on commit 29630e6

Please sign in to comment.