only use -flto=10 with gcc
gcc allows flto=<jobs> to parallelize linking, clang does not understand this, use just -flto for clang and -flto=10 for gcc.
This commit is contained in:
parent
790c9e13bd
commit
b468eddfa5
|
@ -291,8 +291,14 @@ ENDIF()
|
|||
# Compiler flags
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET(LTO_FLAG -flto=10)
|
||||
ELSE()
|
||||
SET(LTO_FLAG -flto)
|
||||
ENDIF()
|
||||
|
||||
# common optimization flags
|
||||
SET(MY_C_AND_CXX_OPT_FLAGS -O2 -mtune=generic -fomit-frame-pointer -flto=10)
|
||||
SET(MY_C_AND_CXX_OPT_FLAGS -O2 -mtune=generic -fomit-frame-pointer ${LTO_FLAG})
|
||||
|
||||
# common debug flags
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
|
Loading…
Reference in New Issue