From 171bc770591461bb18ad16c2a0d238169b8912f6 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 16 Jun 2018 17:58:29 +0800 Subject: [PATCH 1/2] Turn on Control Flow Guard for MSVC builds The performance impact should be negligible according to the documentation on msdn. Closes #9101. --- conf.pri.windows | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf.pri.windows b/conf.pri.windows index ef6edc773..497d62f87 100644 --- a/conf.pri.windows +++ b/conf.pri.windows @@ -61,3 +61,8 @@ DEFINES += BOOST_USE_WINAPI_VERSION=0x0501 # Enable stack trace support CONFIG += stacktrace + +win32-msvc* { + QMAKE_CXXFLAGS += "/guard:cf" + QMAKE_LFLAGS += "/guard:cf" +} From 33bb3719d709c7f2172a6131f3746d975d17e26f Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 18 Jun 2018 00:32:22 +0800 Subject: [PATCH 2/2] Move optimization flags Those flags aren't strictly required when compiling but they are recommended to be on. --- conf.pri.windows | 1 + winconf.pri | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.pri.windows b/conf.pri.windows index 497d62f87..dab9d8cc9 100644 --- a/conf.pri.windows +++ b/conf.pri.windows @@ -65,4 +65,5 @@ CONFIG += stacktrace win32-msvc* { QMAKE_CXXFLAGS += "/guard:cf" QMAKE_LFLAGS += "/guard:cf" + QMAKE_LFLAGS_RELEASE += "/OPT:REF /OPT:ICF" } diff --git a/winconf.pri b/winconf.pri index ac5153814..0c700380f 100644 --- a/winconf.pri +++ b/winconf.pri @@ -39,7 +39,6 @@ win32-g++* { else:win32-msvc* { CONFIG -= embed_manifest_exe QMAKE_LFLAGS += "/MANIFEST:EMBED /MANIFESTINPUT:$$quote($${PWD}/src/qbittorrent.exe.manifest) /STACK:0x800000" - QMAKE_LFLAGS_RELEASE += "/OPT:REF /OPT:ICF" RC_FILE = qbittorrent.rc