File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.8 )
1+ cmake_minimum_required (VERSION 3.9 )
22project (ccls LANGUAGES CXX)
33
44option (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)
3030set_property (TARGET ccls PROPERTY CXX_STANDARD_REQUIRED ON )
3131set_property (TARGET ccls PROPERTY CXX_EXTENSIONS OFF )
3232
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+
3340# CMake sets MSVC for both MSVC and Clang(Windows)
3441if (MSVC )
3542 # Common MSVC/Clang(Windows) options
You can’t perform that action at this time.
0 commit comments