Commit Graph

81 Commits

Author SHA1 Message Date
Chocobo1
3d24a4e0f7
Specify standards conformance mode to MSVC
https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170

PR #20427.
2024-02-18 13:03:00 +08:00
Chocobo1
298e4ba852
Revert "Set symbol visibility to hidden"
This negatively affect stacktrace functionality.
This reverts commit 50680a3d9b.

PR #19942.
2023-11-15 21:25:45 +08:00
Chocobo1
50680a3d9b
Set symbol visibility to hidden
This suppresses compiler warnings in GHA CI:
>ld: warning: direct access in function 'std::__1::__function::__func<libtorrent::storage_interface* (*)(libtorrent::storage_params const&, libtorrent::file_pool&), std::__1::allocator<libtorrent::storage_interface* (*)(libtorrent::storage_params const&, libtorrent::file_pool&)>, libtorrent::storage_interface* (libtorrent::storage_params const&, libtorrent::file_pool&)>::target(std::type_info const&) const' from file '/usr/local/lib/libtorrent-rasterbar.a(create_torrent.cpp.o)' to global weak symbol 'typeinfo name for libtorrent::storage_interface* (*)(libtorrent::storage_params const&, libtorrent::file_pool&)' from file 'src/base/libqbt_base.a(mocs_compilation.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

And also makes the binary a bit smaller.

https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Code-Gen-Options.html#index-fvisibility

PR #19921.
2023-11-14 14:07:04 +08:00
Chocobo1
606c23d1a4 Use highest compression algorithm & level
https://doc.qt.io/qt-6/resources.html#compression
2023-11-06 14:10:27 +08:00
Chocobo1
031be41491 Bump Windows macro versions 2023-10-29 17:40:02 +08:00
Vladimir Golovnev
33d767b765
Disable using Qt functions deprecated up to Qt 6.5
* Disable using Qt functions deprecated up to Qt 6.5
* Utilize QSet::removeIf()

PR #19419.
2023-08-08 08:52:13 +03:00
Chocobo1
d554db4f4e
Revise wording 2023-08-01 15:27:04 +08:00
Vladimir Golovnev
10ee1ab7a2
Switch to C++20
PR #19336.
2023-07-21 15:38:49 +03:00
Vladimir Golovnev
dbe79484d2
Drop support of Qt 5
Also remove usage of some deprecated stuff.

PR #19338.
2023-07-20 11:17:27 +03:00
Chocobo1
5dcc14153f
Move feature macro declaration to build scripts
PR #18825.
2023-04-10 13:38:00 +08:00
Chocobo1
03da68b1cf
Add support for unit testing
* Downgraded macOS CI to Qt 6.2.0 due to a bug in Qt Test module
* Revised cmake build scripts
* For now, only building via cmake is supported

PR #17338.
2022-07-10 13:20:27 +08:00
Chocobo1
7764169aa3
Disallow narrowing conversions in signal connection 2022-05-19 12:55:07 +08:00
Chocobo1
567dd3fabb
Disable compiler specific extensions
The property is set to ON by default, now turn it off.
2022-05-19 12:55:05 +08:00
sledgehammer999
f5239ffb0b
CMake: Use installed Qt's translations for packaging 2022-03-29 01:52:23 +03:00
Chocobo1
efc04645b7
Use QString literals
It covers src/webui and enables `QT_NO_CAST_FROM_ASCII`.
2022-03-20 13:33:40 +08:00
Chocobo1
7aa859a442
Don't use deprecated statfs64() on macOS (#15661)
Co-authored-by: Nick Korotysh <kolchaprogrammer@list.ru>
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
2021-11-02 10:41:09 +08:00
Chocobo1
e006538514
Fix cmake script (#15309)
Fix up 138c911ef4.
2021-08-11 13:26:15 +08:00
Vladimir Golovnev (glassez)
925bf7715c
Disable functions deprecated in Qt 5.15.2 and earlier 2021-07-15 10:56:49 +03:00
Vladimir Golovnev (Glassez)
2bd2490539 Disable functions deprecated in Qt 5.14 and earlier 2021-06-16 17:56:40 +03:00
Francisco Pombal
0c71756009
CMake: fix MSVC __cplusplus (#13934) 2021-05-27 06:57:22 +03:00
FranciscoPombal
2f6abb8aa1 CMake: fix compiler identification checks 2021-05-26 09:46:08 +03:00
Chocobo1
89559eae2b
Disable clang "range loop analysis" compiler warning
See: https://github.com/qbittorrent/qBittorrent/pull/13915#issuecomment-739449084
2021-01-09 12:59:07 +08:00
Chocobo1
24fa9e32b0
Set source character sets to UTF-8
This suppress warning C4819.
https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-160
2021-01-07 11:51:24 +08:00
Chocobo1
c669401767
Generate version header when configuring project
The basic idea is we create a version header template at
"src/base/version.h.in" and the build systems are expected to replace
strings that are enclosed with @ symbols and generate
"src/base/version.h" for other source files to consume/include.
2021-01-04 22:28:41 +08:00
Chocobo1
d70b893852
Bump project requirement to C++17 2020-12-31 13:28:48 +08:00
jagannatharjun
8696988d53 Fix CMake generated qBittorrent's version string
${qBittorrent_VERSION} will expand to a string that ends with build number but version string from qMake doesn't end with build number
2020-10-02 23:57:03 +05:30
Chocobo1
a675b9305b
Add compile flags from conf.pri.windows file to cmake 2020-09-21 12:16:47 +08:00
Chocobo1
7fed0391ba
Don't impose unnecessary compile options on users
This is unexpected for users that take single job compilation as the
default (which is always the case since forever). Users can change the
default if they wish to use multicore for compilation.
2020-09-18 13:58:45 +08:00
FranciscoPombal
46123b9989 CMake: overhaul and improve scripts
- Bump minimum required version and
make use of more modern language features
- Rely more on target_...() commands to establish dependency
relationships between targets rather than directory property commands
- Improve libtorrent package discovery
- Enable and handle application features more explicitly
- Improve user-facing output
- Fix various compilation issues on Windows (MSVC and MinGW) and macOS
- Improve handling of translations
- Add explanatory comments where relevant
- Make CMake scripts fully independent of qmake files/details
- Remove old functions/macros
2020-09-17 13:13:26 +01:00
jagannatharjun
d355491b85 Use default warning level with MSVC in CMake
Previously used warning level 4 creates a lot of noise that largely come from Qt headers
2020-07-17 14:41:48 +05:30
Vladimir Golovnev (Glassez)
bc05f3f76b
CMake: Fix typo 2020-05-02 17:56:21 +03:00
FranciscoPombal
d593d6baa1 CMake: Enforce minimum C++ mode support 2020-04-28 15:50:16 +01:00
NotTsunami
f066d8d786 CMake: Remove glibc version detection
If we were conditionally enabling _BSD_SOURCE or _SVID_SOURCE, I can
understand trying to play nice with the compiler and only pass as
needed, however this is not the case and glibc <= 2.19 will not care
that we are passing _DEFAULT_SOURCE. This removes an unnecessary
build step and gives us less to maintain from a build system
perspective.

Small cosmetic changes to MacroQbtCompilerSettings are included.
2020-01-19 15:08:37 -05:00
NotTsunami
b7f2122c06 CMake: Remove duplicate MSVC check
As of this commit, L98 of winconf.cmake already checks for MSVC
before winconf-msvc calls this macro, so we are guaranteed to be
satisfy the check.
2020-01-18 09:36:56 -05:00
NotTsunami
451585b5de CMake: Remove additional debugging compiler flags
Our previous setup lead to two unintended consequences:

* Debug flags were included in both release and debug builds instead
of just debug builds
* Clang doesn't support -gX (where X is the level of debugging
optimization), but we checked for -Og support instead

This commit avoids both of these scenarios by removing the additional
flags altogether. Partial resolution to #11856.
2020-01-14 10:18:59 -05:00
Luigi Baldoni
2f83587f2a
Remove -march=native optimisation 2019-12-08 13:13:59 +08:00
Prince Gupta
e3879f9ab9 CMake: Use libraries from winconf.pri 2019-11-12 10:43:25 +05:30
Chocobo1
bb23366912
Fix missing libraries in cmake-mingw build 2019-10-19 14:03:39 +08:00
Chocobo1
ccbd9c83e2
Update libtorrent build defines on Windows
`TORRENT_USE_LIBCRYPTO` replaced `TORRENT_USE_OPENSSL` since OpenSSL 1.1.
`TORRENT_DISABLE_RESOLVE_COUNTRIES` has been removed since libtorrent 1.2.
2019-10-09 10:44:42 +08:00
Vladimir Golovnev (Glassez)
6bfa4370b7
CMake: Fix Windows build 2019-08-06 21:50:39 +03:00
Mike Tzou
ec4240dd06
Merge pull request #11016 from Chocobo1/vista
Raise minimum support to Windows 7
2019-08-06 10:17:11 +08:00
Chocobo1
2f0ae7a7d8
Raise minimum support to Windows 7 2019-08-05 02:31:19 +08:00
Vladimir Golovnev (Glassez)
6fe063146f
CMake: Apply QBT_ADDITONAL_FLAGS on all systems 2019-08-02 19:32:56 +03:00
Vladimir Golovnev (Glassez)
3093751fa4
CMake: Fix compilation on Windows with MSVC 2019-08-02 19:32:53 +03:00
Vladimir Golovnev (Glassez)
38cf1fb3ee
Improve CMake configuration
Don't search for QtSingleApplication library.
Fix building on Windows with MinGW.
2019-07-21 16:41:17 +03:00
Chocobo1
4a90716843
Add override keyword to functions 2019-07-19 11:58:56 +08:00
Chocobo1
752d4b85ea
Remove compiler warning flags
Apperently nobody care about those warnings so just remove them and let
other more important warnings stand out.
2019-07-18 14:54:51 +08:00
Chocobo1
38b6ee9e75
Remove workaround for boost 1.39
... by raising minimum version to 1.40.
Bug report: https://svn.boost.org/trac10/ticket/3095
2019-06-23 11:09:05 +08:00
Mike Tzou
1831f71cc4
Merge pull request #10833 from Chocobo1/invokeMethod
Use functor based QMetaObject::invokeMethod
2019-06-22 11:24:47 +08:00
Prince Gupta
ece70daaa5 Fix CMake Windows compilation 2019-06-21 18:05:19 +05:30