Skip to content

Commit a172dc4

Browse files
committed
feat(cmake): allow MinSizeRel to use LTO
1 parent e59dbdd commit a172dc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmake/link_time_optimization.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ include(CheckIPOSupported)
33
check_ipo_supported(RESULT ipo_supported)
44

55
function(enable_lto target_name)
6-
if (ipo_supported AND (${CMAKE_BUILD_TYPE} STREQUAL "Release"))
7-
message(STATUS "LTO enabled")
6+
if (ipo_supported AND ((${CMAKE_BUILD_TYPE} STREQUAL "Release") OR (${CMAKE_BUILD_TYPE} STREQUAL "MinSizeRel")))
7+
message(STATUS "LTO enabled for ${target_name}")
88
set_target_properties(${target_name} PROPERTIES
99
INTERPROCEDURAL_OPTIMIZATION TRUE)
1010
else ()

0 commit comments

Comments
 (0)