diff options
Diffstat (limited to 'configure.cmake')
-rw-r--r-- | configure.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.cmake b/configure.cmake new file mode 100644 index 0000000000..97b4bc6599 --- /dev/null +++ b/configure.cmake @@ -0,0 +1,12 @@ +include(CheckCXXSourceCompiles) + +# VC++ guarantees support for LTCG (LTO's equivalent) +if(NOT WIN32) + # Function required to give CMAKE_REQUIRED_* local scope + function(check_have_lto) + set(CMAKE_REQUIRED_FLAGS -flto) + set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=gold) + check_cxx_source_compiles("int main() { return 0; }" HAVE_LTO) + endfunction(check_have_lto) + check_have_lto() +endif(NOT WIN32) |