Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--build_files/cmake/platform/platform_unix.cmake13
2 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 521dfdf4f02..9f0ff3d1427 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -475,6 +475,8 @@ endif()
if(CMAKE_COMPILER_IS_GNUCC)
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
mark_as_advanced(WITH_LINKER_GOLD)
+ option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
+ mark_as_advanced(WITH_LINKER_LLD)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index 050ab8f3ba1..8a89ce40432 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -575,6 +575,19 @@ if(CMAKE_COMPILER_IS_GNUCC)
unset(LD_VERSION)
endif()
+ if(WITH_LINKER_LLD)
+ execute_process(
+ COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version
+ ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
+ if("${LD_VERSION}" MATCHES "LLD")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
+ else()
+ message(STATUS "LLD linker isn't available, using the default system linker.")
+ endif()
+ unset(LD_VERSION)
+ endif()
+
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")