aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2017-11-29 23:48:43 +0300
committerDominic Hamon <dominichamon@users.noreply.github.com>2017-11-29 12:48:43 -0800
commitc45f01866bdfe7c62a83b51dfb974acb7fa5cab6 (patch)
tree93c286781464ca021555a65707464ab9c518a663 /CMakeLists.txt
parenteae42212ced6a5cbd5658b629f70d8851a922b61 (diff)
downloadgoogle-benchmark-c45f01866bdfe7c62a83b51dfb974acb7fa5cab6.tar.gz
CMake: implement LTO for clang. Fixes #478 (#487)
* CMake: implement LTO for clang. Fixes #478 * LTO: add basic docs about required executables.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb8acb6..44acc28 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,7 @@ option(BENCHMARK_BUILD_32_BITS "Build a 32 bit version of the library." OFF)
option(BENCHMARK_ENABLE_INSTALL "Enable installation of benchmark. (Projects embedding benchmark may want to turn this OFF.)" ON)
# Make sure we can import out CMake functions
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Read the git tags to determine the project version
@@ -132,6 +133,8 @@ else()
if (GCC_RANLIB)
set(CMAKE_RANLIB ${GCC_RANLIB})
endif()
+ elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+ include(llvm-toolchain)
endif()
endif()