[x265] [PATCH] [RFC] LTO

Steve Borho steve at borho.org
Thu Jun 25 17:50:04 CEST 2015


On 06/24, Peter Kov???? wrote:
> # HG changeset patch
> # User Peter Kov???? <peter.kovar at reflexion.tv>
> # Date 1435170971 -7200
> #      Wed Jun 24 20:36:11 2015 +0200
> # Node ID 9e80570db6045a234041a072d56721b9ab9b1296
> # Parent  3a5cd130f9084147168c02f26de102faf59d193b
> [RFC] LTO
> 
> Link time optimization.
> 
> diff -r 3a5cd130f908 -r 9e80570db604 source/CMakeLists.txt
> --- a/source/CMakeLists.txt	Mon Jun 22 17:39:54 2015 -0700
> +++ b/source/CMakeLists.txt	Wed Jun 24 20:36:11 2015 +0200
> @@ -458,6 +458,13 @@
>      endif()
>  endif()
>  
> +option(ENABLE_LTO "Enable link time optimization" OFF)
> +if(ENABLE_LTO)
> +    if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
> +        list(APPEND LINKER_OPTIONS "--lto")
> +    endif()
> +endif()

there is a similar flag for MSVC (/LTCG, I think) but it's not clear how
useful this is on its own. Profile-guided optimizations turn on link
optimizations implicitly in the final build step.  Anyone caring enough
to enable this option should probably be using PGO.

-- 
Steve Borho


More information about the x265-devel mailing list