summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-11-16 14:05:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-11-16 14:06:10 (GMT)
commitd98b61c68770150e4773ce30eb8145ad487016da (patch)
treeeec43f5aa693e1195680cfc2fab083a16aabb8b7 /Modules
parent696edd17045b61b2166f640b65ac9e464e3a1386 (diff)
parent3155b23260472404a5abda344537e4994eabb054 (diff)
downloadCMake-d98b61c68770150e4773ce30eb8145ad487016da.zip
CMake-d98b61c68770150e4773ce30eb8145ad487016da.tar.gz
CMake-d98b61c68770150e4773ce30eb8145ad487016da.tar.bz2
Merge topic 'clang_windows_thinlto'
3155b23260 Clang/Windows: Use ThinLTO if possible to match other platforms Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6730
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Windows-Clang.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 1c32018..c4d6fd8 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -56,7 +56,12 @@ macro(__windows_compiler_clang_gnu lang)
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
- set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto")
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto=thin")
+ else()
+ set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto")
+ endif()
+
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
set(CMAKE_${lang}_ARCHIVE_CREATE_IPO "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")