1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

cmake: Add a flag to enable LTO

This adds -DLLVM_ENABLE_LTO, rather than forcing people to manually
add -flto to the various _FLAGS variables.

llvm-svn: 259766
This commit is contained in:
Justin Bogner 2016-02-04 07:28:30 +00:00
parent a26758c5e3
commit d393294b5b
2 changed files with 11 additions and 0 deletions

View File

@ -656,6 +656,13 @@ append_if(LLVM_BUILD_INSTRUMENTED "-fprofile-instr-generate"
CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS) CMAKE_SHARED_LINKER_FLAGS)
option(LLVM_ENABLE_LTO "Enable link-time optimization" OFF)
append_if(LLVM_ENABLE_LTO "-flto"
CMAKE_CXX_FLAGS
CMAKE_C_FLAGS
CMAKE_EXE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)
# Plugin support # Plugin support
# FIXME: Make this configurable. # FIXME: Make this configurable.
if(WIN32 OR CYGWIN) if(WIN32 OR CYGWIN)

View File

@ -347,6 +347,10 @@ LLVM-specific variables
are ``Address``, ``Memory``, ``MemoryWithOrigins``, ``Undefined``, ``Thread``, are ``Address``, ``Memory``, ``MemoryWithOrigins``, ``Undefined``, ``Thread``,
and ``Address;Undefined``. Defaults to empty string. and ``Address;Undefined``. Defaults to empty string.
**LLVM_ENABLE_LTO**:BOOL
Add the ``-flto`` flag to the compile and link command lines,
enabling link-time optimization. Defaults to OFF.
**LLVM_PARALLEL_COMPILE_JOBS**:STRING **LLVM_PARALLEL_COMPILE_JOBS**:STRING
Define the maximum number of concurrent compilation jobs. Define the maximum number of concurrent compilation jobs.