mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 17:11:59 +00:00
Build using LTO if compiler supports it (requires Cmake 3.9)
This commit is contained in:
parent
c5acf62060
commit
39ec1549af
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.8)
|
cmake_minimum_required(VERSION 3.9)
|
||||||
project(ccls LANGUAGES CXX)
|
project(ccls LANGUAGES CXX)
|
||||||
|
|
||||||
option(USE_SYSTEM_RAPIDJSON "Use system RapidJSON instead of the git submodule if exists" ON)
|
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)
|
|||||||
set_property(TARGET ccls PROPERTY CXX_STANDARD_REQUIRED ON)
|
set_property(TARGET ccls PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||||
set_property(TARGET ccls PROPERTY CXX_EXTENSIONS OFF)
|
set_property(TARGET ccls PROPERTY CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
# Build using LTO if the compiler supports it
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
check_ipo_supported(RESULT ipo OUTPUT error)
|
||||||
|
if (ipo)
|
||||||
|
set_property(TARGET ccls PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# CMake sets MSVC for both MSVC and Clang(Windows)
|
# CMake sets MSVC for both MSVC and Clang(Windows)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Common MSVC/Clang(Windows) options
|
# Common MSVC/Clang(Windows) options
|
||||||
|
Loading…
Reference in New Issue
Block a user