1 include(CheckCXXSourceCompiles)
3 # VC++ guarantees support for LTCG (LTO's equivalent)
5 # Function required to give CMAKE_REQUIRED_* local scope
6 function(check_have_lto)
7 set(CMAKE_REQUIRED_FLAGS -flto)
8 set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=gold)
9 check_cxx_source_compiles("int main() { return 0; }" HAVE_LTO)
10 endfunction(check_have_lto)