diff options
author | Drashna Jaelre <drashna@live.com> | 2019-05-02 08:03:42 -0700 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-02 08:03:42 -0700 |
commit | 7e655a207e58fb8e5c7d76bd5727558e6b4c8b0c (patch) | |
tree | 3fc26c13ac531dbe71d18571e7ede29e5e39fea5 /tmk_core | |
parent | 55d37d9fbcd85a49acbf539d751f0003e7b770ed (diff) | |
download | qmk_firmware-7e655a207e58fb8e5c7d76bd5727558e6b4c8b0c.tar.gz qmk_firmware-7e655a207e58fb8e5c7d76bd5727558e6b4c8b0c.zip |
Add option to enable LTO easily (#5674)
* Add option to enable LTO easily and disable features that cause compiling errors with LTO
* Add documentation about LTO option
* Add to show_options
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common.mk | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 94f3c2380d..2216887555 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -208,6 +208,13 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes) TMK_COMMON_DEFS += -DSHARED_EP_ENABLE endif + +ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes) + EXTRAFLAGS += -flto + TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE + TMK_COMMON_DEFS += -DNO_ACTION_MACRO + TMK_COMMON_DEFS += -DNO_ACTION_FUNCTION +endif # Bootloader address ifdef STM32_BOOTLOADER_ADDRESS TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS) |