Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
endif()

if(CMAKE_BUILD_TYPE MATCHES "Release")
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_CHECK_MSG)
if(IPO_SUPPORTED)
message(STATUS "Link-time optimization enabled.")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
else()
message(WARNING "Link-time optimization is not enabled: ${IPO_CHECK_MSG}.")
endif()
else()
message(STATUS "Link-time optimization is disabled for non-Release builds.")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
endif()

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Set general compressor
Expand Down
Loading