There was an error while loading. Please reload this page.
1 parent 69e01f3 commit fd995f3Copy full SHA for fd995f3
1 file changed
CMakeLists.txt
@@ -108,6 +108,19 @@ if(ENABLE_WARNINGS)
108
endif()
109
110
111
+option(ENABLE_LTO "Enable interprocedural optimization for Release builds." ON)
112
+if(ENABLE_LTO)
113
+ include(CheckIPOSupported)
114
+ check_ipo_supported(RESULT H3_IPO_SUPPORTED
115
+ OUTPUT H3_IPO_CHECK_OUTPUT
116
+ LANGUAGES C)
117
+ if(H3_IPO_SUPPORTED)
118
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
119
+ else()
120
+ message(STATUS "IPO/LTO is not supported: ${H3_IPO_CHECK_OUTPUT}")
121
+ endif()
122
+endif()
123
+
124
if(NOT MSVC)
125
# Compiler options are set only on non-Windows, since these options are not
126
# correct for MSVC.
0 commit comments