Skip to content

Commit

Permalink
Add CMAKE_INTERPROCEDURAL_OPTIMIZATION
Browse files Browse the repository at this point in the history
The linker is using link time optimizations anyway; this adds -flto=auto which enables parallel link-time optimization
  • Loading branch information
ianmccul committed Nov 28, 2024
1 parent 008db06 commit 83dfac6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 83dfac6

Please sign in to comment.