aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorTobias Hieta <tobias@plex.tv>2020-01-09 12:10:55 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-01-13 23:14:49 +0100
commit4ccf7622db04af58442c460b8091b952585de5c7 (patch)
tree7451edcf604d1703661c28eea1238ef73402ef72 /src/CMakeLists.txt
parentf128c00a99ffb7482740f3579f42f5e026a1ee74 (diff)
CMake: Add support for CMAKE_LTO option.
This enables Link Time Optimization. LTO is a proven technique for optimizing across compilation units. Closes #4799
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
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})