We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5acf62 commit 39ec154Copy full SHA for 39ec154
1 file changed
CMakeLists.txt
@@ -1,4 +1,4 @@
1
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.9)
2
project(ccls LANGUAGES CXX)
3
4
option(USE_SYSTEM_RAPIDJSON "Use system RapidJSON instead of the git submodule if exists" ON)
@@ -30,6 +30,13 @@ set_property(TARGET ccls PROPERTY CXX_STANDARD 17)
30
set_property(TARGET ccls PROPERTY CXX_STANDARD_REQUIRED ON)
31
set_property(TARGET ccls PROPERTY CXX_EXTENSIONS OFF)
32
33
+# Build using LTO if the compiler supports it
34
+include(CheckIPOSupported)
35
+check_ipo_supported(RESULT ipo OUTPUT error)
36
+if (ipo)
37
+ set_property(TARGET ccls PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
38
+endif()
39
+
40
# CMake sets MSVC for both MSVC and Clang(Windows)
41
if(MSVC)
42
# Common MSVC/Clang(Windows) options
0 commit comments