diff --git a/CMakeLists.txt b/CMakeLists.txt index fba7a4d07..01c7c0542 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,10 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Enable folders for IDEs set_property(GLOBAL PROPERTY USE_FOLDERS ON) +# Enable LTO (link time optimization) for the project +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=auto") + # --------------------------------------------------- # Other configuration options # ---------------------------------------------------