From 4ccf7622db04af58442c460b8091b952585de5c7 Mon Sep 17 00:00:00 2001 From: Tobias Hieta Date: Thu, 9 Jan 2020 12:10:55 +0100 Subject: CMake: Add support for CMAKE_LTO option. This enables Link Time Optimization. LTO is a proven technique for optimizing across compilation units. Closes #4799 --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 63e2b943d..054541e40 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,6 +46,12 @@ add_executable( ${CURL_FILES} ) +if(CURL_HAS_LTO) + set_target_properties(${EXE_NAME} PROPERTIES + INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE + INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE) +endif() + source_group("curlX source files" FILES ${CURLX_CFILES}) source_group("curl source files" FILES ${CURL_CFILES}) source_group("curl header files" FILES ${CURL_HFILES}) -- cgit v1.2.3