mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:03:36 +03:00
CMake: Add support for CMAKE_LTO option.
This enables Link Time Optimization. LTO is a proven technique for optimizing across compilation units. Closes #4799
This commit is contained in:
parent
f128c00a99
commit
4ccf7622db
3 changed files with 30 additions and 0 deletions
|
|
@ -96,6 +96,12 @@ endif()
|
|||
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
|
||||
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "")
|
||||
|
||||
if(CURL_HAS_LTO)
|
||||
set_target_properties(${LIB_NAME} PROPERTIES
|
||||
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
|
||||
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
# Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue