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