File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,6 @@ cmake_policy(SET CMP0077 NEW)
2121# Let AUTOMOC and AUTOUIC process GENERATED files.
2222cmake_policy (SET CMP0071 NEW)
2323
24- # Interfers with Qt so off by default.
25- option (LINK_TIME_OPTIMIZATION "Flag to control link time optimization: off by default" OFF )
26-
27- if (LINK_TIME_OPTIMIZATION)
28- set (CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE )
29- endif ()
3024
3125# Allow to use external shared boost libraries
3226option (USE_SYSTEM_BOOST "Use system shared Boost libraries" OFF )
@@ -55,6 +49,15 @@ project(OpenROAD VERSION 1
5549 LANGUAGES CXX
5650)
5751
52+ # LTO setting must come after project() for proper compiler detection
53+ option (LINK_TIME_OPTIMIZATION "Flag to control link time optimization: on by default" ON )
54+ if (LINK_TIME_OPTIMIZATION)
55+ set (CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE )
56+ message (STATUS "LTO is enabled" )
57+ else ()
58+ message (STATUS "LTO is disabled: ${LTO_ERROR} " )
59+ endif ()
60+
5861set (OPENROAD_HOME ${PROJECT_SOURCE_DIR} )
5962set (OPENROAD_SHARE ${CMAKE_INSTALL_PREFIX} /share/openroad)
6063
Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ if (Qt5_FOUND AND BUILD_GUI)
8585 OpenSTA
8686 )
8787
88+ # Disable LTO for gui. LTO causes a crash with Qt plugin loading
89+ set_target_properties (gui PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF )
90+
8891messages(
8992 TARGET gui
9093)
You can’t perform that action at this time.
0 commit comments