Move LTCG/LTO enablement into the build scripts

This commit is contained in:
Cameron Gutman
2026-05-26 21:46:58 -05:00
parent adfc972371
commit 81f20cdb66
3 changed files with 10 additions and 15 deletions
-15
View File
@@ -20,21 +20,6 @@ CONFIG(release, debug|release) {
}
}
# Enable LTCG/LTO for release builds
CONFIG(release, debug|release) {
*-msvc {
QMAKE_CFLAGS += /GL
QMAKE_CXXFLAGS += /GL
QMAKE_LFLAGS += /LTCG
}
macx {
QMAKE_CFLAGS += -flto=thin
QMAKE_CXXFLAGS += -flto=thin
QMAKE_LFLAGS += -flto=thin
}
}
# Enable ASan for Linux or macOS
#CONFIG += sanitizer sanitize_address
+5
View File
@@ -154,6 +154,11 @@ mkdir %BUILD_FOLDER%
mkdir %INSTALLER_FOLDER%
mkdir %SYMBOLS_FOLDER%
rem Enable LTCG for official builds
set CFLAGS=/GL
set CXXFLAGS=/GL
set LDFLAGS=/LTCG
echo Configuring the project
pushd %BUILD_FOLDER%
%QMAKE_CMD% %SOURCE_ROOT%\moonlight-qt.pro
+5
View File
@@ -41,6 +41,11 @@ mkdir $BUILD_ROOT
mkdir $BUILD_FOLDER
mkdir $INSTALLER_FOLDER
# Enable LTO for official builds
export CFLAGS=-flto=thin
export CXXFLAGS=-flto=thin
export LDFLAGS=-flto=thin
echo Configuring the project
pushd $BUILD_FOLDER
qmake $SOURCE_ROOT/moonlight-qt.pro QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" || fail "Qmake failed!"