ci: Adapt warning configuration to new release of MSVC 19 Recently, MSVC introduced a new warning C5240 that apparently refers to standard-compliant ordering of attributes and decl-specifies. Unfortunately, this warning is triggered by Qt headers, in particular: C:\CraftMaster\windows-msvc2019_64-cl\include\qt5\QtGui/qcolor.h(233): warning C5240: 'nodiscard': attribute is ignored in this syntactic position Since we cannot fix this ourselves, make the warning non-fatal for now. This fixes our CI failing with the new MSVC version. Reenable C4244, which is no longer triggered by Quassel code, and add some reasoning for the remaining warnings.
cmake: Modernize (and fix) deployment on macOS For the past decade or so, we have used a bunch of self-written python and bash scripts for creating packages for macOS. These have not aged well, and recently several workarounds had to be hacked in to keep the machinery somewhat working at all. Still, invoking the scripts at build time rather than install time caused a race condition where sometimes not all the packages would be created in CI. To break the camel's back, deploying dependencies no longer worked correctly and broke the packages completely in 0.14-rc1. Fix this by modernizing the whole deployment process and related parts of the build system, replacing the custom scripts by relying on Qt's and CMake's own tooling instead. Some workarounds still need to be added to that to make everything work correctly (neither tool can deal correctly with QtWebEngine, for some reason, and CMake's Info.plist template lacks functionality), but the main part of the work is now delegated to official tooling, everything properly happend at install time avoiding race conditions in the build process, and we can remove a bunch of decade-old and hardly maintained custom code. Also adapt the CI configuration to use -DBUNDLE instead of the old -DDEPLOY, and remove the explicit setting of qmake's path too, as it is no longer needed now.
cmake: Ignore -Wdeprecated-declarations instead of -Wdeprecated Qt 5.15 introduced a bunch of deprecation warnings that are hard to fix due to our long-term support of old Qt versions. For this reason, we added -Wno-error=deprecated to compile flags, which should make deprecation warnings non-fatal. However, for some reason, GCC 10.2.1 on Debian Testing thinks that -Wno-error=deprecated should not include -Wdeprecated-declarations, thus failing the build with fatal warnings on. I could not reproduce this behavior on other distros with the same compiler and Qt versions, so maybe this is a distro-specific issue. However, we only care about -Wdeprecated-declarations, so making only this specific warning non-fatal makes more sense anyway.
cmake: Allow deprecation warnings In recent releases, Qt deprecated a whole bunch of APIs, probably in preparation of the advent of Qt 6. Unfortunately, avoiding those is not straightforward, since Quassel has to support a broad range of older Qt releases, and not all deprecated APIs are easy to replace in those older versions. Some APIs, such as bearer management, don't even have a replacement yet. Since Qt 5.13, deprecation warnings cannot be disabled at all. To avoid breaking the CI builds, make deprecation warnings non-fatal even if FATAL_WARNINGS is enabled. This allows us to remove the WARN_QT_DEPRECATION option, which only had an effect when building against Qt < 5.13 anyway, and unconditionally enable the warnings when compiling with GCC or Clang. For MSVC, disable deprecation warnings completely, since there seems to be no way to selectively make warnings non-fatal, and we still want to fail for anything other than deprecations. Disable the use of APIs completely that were deprecated in Qt 5.5 (our current baseline) or earlier to prevent accidental use. This threshold can be raised in the future as we can rely on newer Qt versions and modernize affected code.
cmake: fix build on MSYS2 Some minor changes to allow building easily on MSYS2: - don't check for snorenotify on MSYS2 because it segfaults on startup - don't use -fstack-protector-strong (libssp) on MinGW because it currently causes segfaults during static initialization https://sourceforge.net/p/mingw-w64/bugs/755/ - use the `cat` command to read files when using the 'MSYS Makefiles' generator, and not the cmd.exe `type` command - update doc for the quassel_add_module function wrt. 7d0879ab Tested to build correctly on MSYS2 with both the 'MSYS Makefiles' generator and the Ninja generator using a native ninja. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
cmake: Add ENABLE_SHARED option, default ON Add an ENABLE_SHARED option, defaults to ON, when set to OFF quassel_add_module() will build modules as static (does not affect platforms where modules would be built as static anyway.) The option name ENABLE_SHARED is frequently used for this purpose in cmake. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
build: Add Boost 1.0 license for CMake script Add copy of Boost 1.0 license for the included CMake script GetGitRevisionDescription. This addresses licensing concerns for Debian and derivatives. Rename the license file according to existing licenses GPLv2 and v3. See https://www.boost.org/LICENSE_1_0.txt Fixes #1504
cmake: Allow to make compile warnings fatal Failing on any compile warning is very useful in CI builds, so add an option for enabling this. The option defaults to OFF, because we don't want to annoy users that don't want this. Enable fatal warnings in Travis CI.
cmake: Set proper install paths for Windows Instead of dumping everything into the install prefix, set separate paths for runtime and library artifacts. The paths chosen match the expectations of Craft packaging, so we can subsequently remove the overrides in the craft blueprint.