mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 15:29:28 -05:00
Add lto flag only to "internal" source files (#1895)
This commit is contained in:
parent
6193023c8f
commit
936e8279f9
@ -44,7 +44,7 @@ if(cpp20_supported)
|
|||||||
else()
|
else()
|
||||||
set(USE_CPPOPT "-std=c++17")
|
set(USE_CPPOPT "-std=c++17")
|
||||||
endif()
|
endif()
|
||||||
set(USE_CPPOPT "${USE_CPPOPT} -flto -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized -Wno-volatile")
|
set(USE_CPPOPT "${USE_CPPOPT} -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized -Wno-volatile")
|
||||||
|
|
||||||
# Enable this if you want the linker to remove unused code and data
|
# Enable this if you want the linker to remove unused code and data
|
||||||
set(USE_LINK_GC yes)
|
set(USE_LINK_GC yes)
|
||||||
@ -347,10 +347,12 @@ set(CPPSRC
|
|||||||
${HACKRF_CPLD_DATA_CPP}
|
${HACKRF_CPLD_DATA_CPP}
|
||||||
ui_external_items_menu_loader.cpp
|
ui_external_items_menu_loader.cpp
|
||||||
view_factory_base.cpp
|
view_factory_base.cpp
|
||||||
|
|
||||||
${EXTCPPSRC}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set_source_files_properties(${CPPSRC} PROPERTIES COMPILE_FLAGS -flto) # Add lto flag to the non-external sources only
|
||||||
|
|
||||||
|
list (APPEND CPPSRC ${EXTCPPSRC}) # Append external sources after setting lto flag to internal ones
|
||||||
|
|
||||||
# C sources to be compiled in ARM mode regardless of the global setting.
|
# C sources to be compiled in ARM mode regardless of the global setting.
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
||||||
# option that results in lower performance and larger code size.
|
# option that results in lower performance and larger code size.
|
||||||
@ -492,7 +494,6 @@ add_custom_command(
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME}.elf ${CSRC} ${CPPSRC} ${ASMSRC})
|
add_executable(${PROJECT_NAME}.elf ${CSRC} ${CPPSRC} ${ASMSRC})
|
||||||
set_source_files_properties(${EXTCPPSRC} PROPERTIES COMPILE_FLAGS -fno-lto)
|
|
||||||
set_target_properties(${PROJECT_NAME}.elf PROPERTIES LINK_DEPENDS ${LDSCRIPT})
|
set_target_properties(${PROJECT_NAME}.elf PROPERTIES LINK_DEPENDS ${LDSCRIPT})
|
||||||
add_definitions(${DEFS})
|
add_definitions(${DEFS})
|
||||||
include_directories(. ${INCDIR})
|
include_directories(. ${INCDIR})
|
||||||
|
Loading…
Reference in New Issue
Block a user