Skip to content

Commit adfc972

Browse files
committed
Enable LTCG/LTO for release builds
1 parent 53a14ed commit adfc972

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

globaldefs.pri

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ CONFIG(release, debug|release) {
2020
}
2121
}
2222

23+
# Enable LTCG/LTO for release builds
24+
CONFIG(release, debug|release) {
25+
*-msvc {
26+
QMAKE_CFLAGS += /GL
27+
QMAKE_CXXFLAGS += /GL
28+
QMAKE_LFLAGS += /LTCG
29+
}
30+
31+
macx {
32+
QMAKE_CFLAGS += -flto=thin
33+
QMAKE_CXXFLAGS += -flto=thin
34+
QMAKE_LFLAGS += -flto=thin
35+
}
36+
}
37+
2338
# Enable ASan for Linux or macOS
2439
#CONFIG += sanitizer sanitize_address
2540

0 commit comments

Comments
 (0)