aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Drashna Jaelre <drashna@live.com>2019-11-04 15:35:47 -0800
committerGravatar James Young <18669334+noroadsleft@users.noreply.github.com>2019-11-04 15:35:47 -0800
commit29630e6e49487cbf97fa57f47b399d4d5866fe13 (patch)
tree8377d80ae7af053b17a9aeb4e98b53c973caa039
parenta836c85e54bfb06cd685a5444eea377374cebea3 (diff)
downloadqmk_firmware-29630e6e49487cbf97fa57f47b399d4d5866fe13.tar.gz
[Core] Add short form LTO_ENABLE (#7259)
For drashna's sanity's sake
-rw-r--r--docs/config_options.md3
-rw-r--r--tmk_core/common.mk3
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/config_options.md b/docs/config_options.md
index abd98ec8a..c44a47178 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -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
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index db5535346..d43950299 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -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