enable lto

This commit is contained in:
Robin Müller 2022-05-09 02:03:17 +02:00
parent 1fe6fd9ead
commit bd3164bacd
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 16 additions and 8 deletions

View File

@ -13,17 +13,23 @@ cmake_minimum_required(VERSION 3.13)
# set(CMAKE_VERBOSE TRUE)
# Project Name
project(fsfw-example-hosted C CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(NOT FSFW_OSAL)
set(FSFW_OSAL host CACHE STRING "OS for the FSFW.")
endif()
# Project Name
project(fsfw-example-hosted C CXX)
option(OBSW_ADD_FMT_TESTS "Add {fmt} library tests" OFF)
option(OBSW_ENABLE_IPO "Enable IPO/LTO optimization" ON)
find_package(fmt 8 CONFIG)
option(FSFW_ADD_FMT_TESTS "Add {fmt} library tests" ON)
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_ERROR)
if(NOT IPO_SUPPORTED)
message(STATUS "IPO/LTO not supported: ${IPO_ERROR}")
endif()
################################################################################
# Pre-Sources preparation
@ -106,12 +112,14 @@ add_subdirectory(${COMMON_PATH})
# Post-Sources preparation
################################################################################
if(OBSW_ENABLE_IPO AND IPO_SUPPORTED)
set_property(TARGET ${TARGET_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
# Add libraries for all sources.
target_link_libraries(${TARGET_NAME} PRIVATE
${LIB_FSFW_NAME}
${LIB_OS_NAME}
fmt::fmt
# ${LIB_FSFW_HAL_NAME}
)
# Add include paths for all sources.

@ -1 +1 @@
Subproject commit bdc27d72f40155ba1946b6ad71c97069c88ac1b7
Subproject commit 503c6301c63848b38a9f9254e856614b473a27f0

2
fsfw

@ -1 +1 @@
Subproject commit e8a5f1e095f64743e388729de0c9f53ca2e1565c
Subproject commit fb1d775b524760bb3c299b47168604bad504f1f2