From 83dfac6a2e465ad26b6515d40786add2ba511663 Mon Sep 17 00:00:00 2001 From: Ian McCulloch Date: Thu, 28 Nov 2024 19:37:31 +0800 Subject: [PATCH] Add CMAKE_INTERPROCEDURAL_OPTIMIZATION The linker is using link time optimizations anyway; this adds -flto=auto which enables parallel link-time optimization --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf7e0055..64a685da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,9 @@ option(DEV_MODE "Build testing dev_test.cpp with cytnx" OFF) # ##################################################################### project(CYTNX VERSION ${CYTNX_VERSION} LANGUAGES CXX C) +# C++ uses link-time optimization anyway; this enables additionally -flto=auto, for parallel compilation +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + add_library(cytnx STATIC) set_property(TARGET cytnx PROPERTY C_VISIBILITY_PRESET hidden) set_property(TARGET cytnx PROPERTY VISIBILITY_INLINES_HIDDEN ON)