Skip to content

Commit 61d9fcd

Browse files
committed
Reformat Windows build configuration files
1 parent 66a6674 commit 61d9fcd

4 files changed

Lines changed: 113 additions & 107 deletions

File tree

conf.pri.windows

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Adapt these paths
2+
# Point these to the include folders
3+
INCLUDEPATH += $$quote(C:/qBittorrent/boost)
4+
INCLUDEPATH += $$quote(C:/qBittorrent/libtorrent/include)
5+
INCLUDEPATH += $$quote(C:/qBittorrent/zlib/include)
6+
INCLUDEPATH += $$quote(C:/qBittorrent/openssl/include)
7+
# Point these to the lib folders
8+
LIBS += $$quote(-LC:/qBittorrent/boost/stage/lib)
9+
LIBS += $$quote(-LC:/qBittorrent/libtorrent/lib)
10+
LIBS += $$quote(-LC:/qBittorrent/zlib/lib)
11+
LIBS += $$quote(-LC:/qBittorrent/openssl/lib)
12+
13+
# Adapt the lib names/versions accordingly
14+
# If you want to use Boost auto-linking then disable
15+
# BOOST_ALL_NO_LIB below and omit Boost libraries here
16+
CONFIG(debug, debug|release) {
17+
LIBS += libtorrentd.lib \
18+
libboost_system-vc140-mt-sgd-1_64.lib
19+
}
20+
else {
21+
LIBS += libtorrent.lib \
22+
libboost_system-vc140-mt-s-1_64.lib
23+
}
24+
LIBS += libeay32.lib ssleay32.lib
25+
LIBS += zlib.lib
26+
# ...or if you use MinGW
27+
#CONFIG(debug, debug|release) {
28+
# LIBS += libtorrent-rasterbar \
29+
# libboost_system-mt
30+
#}
31+
#else {
32+
# LIBS += libtorrent-rasterbar \
33+
# libboost_system-mt
34+
#}
35+
#LIBS += libcrypto libssl
36+
#LIBS += libz
37+
38+
DEFINES += NTDDI_VERSION=0x05010000
39+
DEFINES += _WIN32_WINNT=0x0501
40+
DEFINES += _WIN32_IE=0x0501
41+
42+
# Disable to use Boost auto-linking
43+
DEFINES += BOOST_ALL_NO_LIB
44+
# Use one of the following options
45+
DEFINES += BOOST_SYSTEM_STATIC_LINK
46+
#DEFINES += BOOST_SYSTEM_DYN_LINK
47+
# Boost 1.60+ defaults to Vista+ support. The define below enables XP support again.
48+
DEFINES += BOOST_USE_WINAPI_VERSION=0x0501
49+
# Enable if building against libtorrent 1.0.x (RC_1_0) (static linking)
50+
#DEFINES += BOOST_ASIO_SEPARATE_COMPILATION
51+
# Enable if building against libtorrent 1.0.x (RC_1_0) (dynamic linking)
52+
#DEFINES += BOOST_ASIO_DYN_LINK
53+
54+
# Enable if building against libtorrent 1.1.x (RC_1_1)
55+
# built with this flag defined
56+
#DEFINES += TORRENT_NO_DEPRECATE
57+
# Enable if linking dynamically against libtorrent
58+
#DEFINES += TORRENT_LINKING_SHARED
59+
60+
# Enable stack trace support
61+
CONFIG += strace_win

winconf-mingw.pri

Lines changed: 0 additions & 35 deletions
This file was deleted.

winconf-msvc.pri

Lines changed: 0 additions & 32 deletions
This file was deleted.

winconf.pri

Lines changed: 52 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,80 @@
1-
# Adapt these paths on Windows
2-
3-
# Point this to the boost include folder
4-
INCLUDEPATH += $$quote(C:/qBittorrent/boost_1_51_0)
5-
# Point this to the libtorrent include folder
6-
INCLUDEPATH += $$quote(C:/qBittorrent/RC_0_16/include)
7-
# Point this to the zlib include folder
8-
INCLUDEPATH += $$quote(C:/qBittorrent/Zlib/include)
9-
# Point this to the openssl include folder
10-
INCLUDEPATH += $$quote(C:/qBittorrent/openssl/include)
11-
12-
# Point this to the boost lib folder
13-
LIBS += $$quote(-LC:/qBittorrent/boost_1_51_0/stage/lib)
14-
# Point this to the libtorrent lib folder
15-
LIBS += $$quote(-LC:/qBittorrent/RC_0_16/bin/path-according-to-the-build-options-chosen)
16-
# Point this to the zlib lib folder
17-
LIBS += $$quote(-LC:/qBittorrent/Zlib/lib)
18-
# Point this to the openssl lib folder
19-
LIBS += $$quote(-LC:/qBittorrent/openssl/lib)
20-
21-
# BOOST DEFINES
22-
DEFINES += BOOST_ALL_NO_LIB
231
DEFINES += BOOST_ASIO_HASH_MAP_BUCKETS=1021
24-
# Disable this if building against libtorrent 1.1.x (RC_1_1)
25-
DEFINES += BOOST_ASIO_SEPARATE_COMPILATION
262
# After 1.55 some Windows users reported regular UI freezes.
273
# This makes ASIO use the pre-1.56 way of doing things. See issue #2003
284
DEFINES += BOOST_ASIO_DISABLE_CONNECTEX
29-
# Boost 1.60+ defaults to Vista+ support. The define below enables XP support again.
30-
DEFINES += BOOST_USE_WINAPI_VERSION=0x0501
315
DEFINES += BOOST_EXCEPTION_DISABLE
32-
DEFINES += BOOST_SYSTEM_STATIC_LINK=1
336

34-
# LIBTORRENT DEFINES
357
DEFINES += TORRENT_USE_OPENSSL
368
DEFINES += TORRENT_DISABLE_GEO_IP
379
DEFINES += TORRENT_DISABLE_RESOLVE_COUNTRIES
3810

39-
# QBT DEFINES
4011
DEFINES += UNICODE
4112
DEFINES += _UNICODE
4213
DEFINES += WIN32
4314
DEFINES += _WIN32
4415
DEFINES += WIN32_LEAN_AND_MEAN
45-
DEFINES += NTDDI_VERSION=0x05010000
46-
DEFINES += _WIN32_WINNT=0x0501
47-
DEFINES += _WIN32_IE=0x0501
4816
DEFINES += _CRT_SECURE_NO_DEPRECATE
4917
DEFINES += _SCL_SECURE_NO_DEPRECATE
5018
DEFINES += __USE_W32_SOCKETS
5119
DEFINES += _FILE_OFFSET_BITS=64
5220
DEFINES += NOMINMAX
5321

5422
CONFIG(debug, debug|release) {
55-
DEFINES += TORRENT_DEBUG
56-
} else {
57-
DEFINES += NDEBUG
23+
DEFINES += TORRENT_DEBUG
24+
}
25+
else {
26+
DEFINES += NDEBUG
5827
}
59-
60-
# Enable backtrace support
61-
CONFIG += strace_win
6228

6329
win32-g++* {
64-
include(winconf-mingw.pri)
30+
CONFIG(debug, debug|release) {
31+
# Make sure binary is not relocatable, otherwise debugging will fail
32+
QMAKE_LFLAGS -= -Wl,--dynamicbase
33+
}
34+
35+
RC_FILE = qbittorrent_mingw.rc
36+
37+
LIBS += libadvapi32 libshell32 libuser32 libole32 libwsock32 libws2_32 libpowrprof
38+
}
39+
else:win32-msvc* {
40+
CONFIG -= embed_manifest_exe
41+
QMAKE_LFLAGS += "/MANIFEST:EMBED /MANIFESTINPUT:$$quote($${PWD}/src/qbittorrent.exe.manifest) /STACK:0x800000"
42+
QMAKE_LFLAGS_RELEASE += "/OPT:REF /OPT:ICF"
43+
44+
RC_FILE = qbittorrent.rc
45+
46+
LIBS += advapi32.lib shell32.lib crypt32.lib User32.lib ole32.lib PowrProf.lib
47+
}
48+
49+
# See an example build configuration in "conf.pri.windows"
50+
exists(conf.pri) {
51+
include(conf.pri)
6552
}
6653
else {
67-
include(winconf-msvc.pri)
54+
error("'conf.pri' does not exist. See an example configuration in 'conf.pri.windows'.")
55+
}
56+
57+
# Stack trace support can be enabled in 'conf.pri'
58+
strace_win {
59+
win32-g++* {
60+
contains(QMAKE_HOST.arch, x86) {
61+
# i686 arch requires frame pointer preservation
62+
QMAKE_CXXFLAGS += -fno-omit-frame-pointer
63+
}
64+
65+
QMAKE_LFLAGS += -Wl,--export-all-symbols
66+
67+
LIBS += libdbghelp
68+
}
69+
else:win32-msvc* {
70+
contains(QMAKE_HOST.arch, x86) {
71+
# i686 arch requires frame pointer preservation
72+
QMAKE_CXXFLAGS += -Oy-
73+
}
74+
75+
QMAKE_CXXFLAGS *= -Zi
76+
QMAKE_LFLAGS *= "/DEBUG"
77+
78+
LIBS += dbghelp.lib
79+
}
6880
}

0 commit comments

Comments
 (0)