aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f30c66e..f241abd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,14 @@ if(DOXYGEN_FOUND)
)
endif(DOXYGEN_FOUND)
+option(use_lto "Enable link time optimalisation" OFF)
+if(use_lto)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto -fwhole-program")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
+endif(use_lto)
+
add_subdirectory(libcmix-bignum)
add_subdirectory(libcmix-crypto)
add_subdirectory(libcmix)