From 3a87af7372053e3fe5a4b9da71897f36a34feaa8 Mon Sep 17 00:00:00 2001 From: Eugene Shalygin Date: Wed, 31 May 2017 15:06:53 +0200 Subject: [PATCH 1/4] travis: Use Ninja in CMake builds make does not show compiler command line when -Werror triggers a compilation error. Ninja does show complete command line in this case, and the command line might be important for analysing a build error. Additionally, final build log contains only lines for generated files and files with compilation warnings, and is much shorter as such. --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd319995b..73d5e5869 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,6 +73,7 @@ addons: # Qt 5.5.1 - qt55base - qt55tools + - ninja-build before_install: # only allow specific build for coverity scan, others will stop @@ -143,7 +144,7 @@ install: if [ "$build_system" = "cmake" ]; then brew unlink cmake - brew install cmake + brew install cmake ninja brew install qt5 brew link --force qt5 @@ -175,7 +176,8 @@ script: mkdir build cd build cmake -DGUI=${gui} -DCMAKE_INSTALL_PREFIX="$qbt_path" "$MY_CMAKE_OPENSSL_HINT" \ - -G "Unix Makefiles" -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE .. + -G "Ninja" -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE .. + BUILD_TOOL="ninja" fi if [ "$build_system" = "qmake" ]; then ./bootstrap.sh && ./configure $qbtconf @@ -184,8 +186,9 @@ script: sed -i "" -e "s/^\(CXX.*&&\).*$/\1 $CXX/" src/Makefile sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile fi + BUILD_TOOL="make" fi - - make && make install + - $BUILD_TOOL && $BUILD_TOOL install after_success: - if [ "$gui" = true ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi From 8c589b8579f45386b6fe118ef98578d5b3feee3b Mon Sep 17 00:00:00 2001 From: Eugene Shalygin Date: Wed, 31 May 2017 15:42:24 +0200 Subject: [PATCH 2/4] travis: use GCC 6 in CMake builds GCC 4.8.4 has a bug with system includes: it does not ignore warnings for files from system include directories. This breaks our Travis builds due to warnings in zlib.h. --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 73d5e5869..498e0dde5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,7 @@ addons: apt: sources: # sources list: https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json - #- ubuntu-toolchain-r-test + - ubuntu-toolchain-r-test #- boost-latest - sourceline: 'ppa:qbittorrent-team/qbittorrent-stable' - sourceline: 'ppa:beineri/opt-qt551-trusty' @@ -74,6 +74,7 @@ addons: - qt55base - qt55tools - ninja-build + - [gcc-6, g++-6] before_install: # only allow specific build for coverity scan, others will stop @@ -95,6 +96,11 @@ before_install: # Qt 5 PATH=/opt/qt55/bin:${PATH} + + if [ "$build_system" = "cmake" ]; then + COMPILER_VERSION=6 + export CXX="${CXX}-${COMPILER_VERSION}" CC="${CC}-${COMPILER_VERSION}" + fi fi # print settings From c2f9f57ef4553b34047154dd5b0c10e481ace6dc Mon Sep 17 00:00:00 2001 From: Eugene Shalygin Date: Wed, 31 May 2017 16:35:40 +0200 Subject: [PATCH 3/4] Travis: group apt packages --- .travis.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 498e0dde5..2df6de5e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,18 +62,12 @@ addons: - sourceline: 'ppa:adrozdoff/cmake' packages: # packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise - - autoconf - - automake - - cmake - - colormake + - [autoconf, automake, colormake] + - [cmake, ninja-build] - libssl-dev - - libboost-dev - - libboost-system-dev + - [libboost-dev, libboost-system-dev] - libtorrent-rasterbar-dev - # Qt 5.5.1 - - qt55base - - qt55tools - - ninja-build + - [qt55base, qt55tools] - [gcc-6, g++-6] before_install: From 72cb8682241c73151c5ea30984db6b03e1ab1d67 Mon Sep 17 00:00:00 2001 From: Eugene Shalygin Date: Wed, 31 May 2017 18:41:46 +0200 Subject: [PATCH 4/4] cmake: disable warnings for bundled QtSingleApplication --- src/app/qtsingleapplication/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/qtsingleapplication/CMakeLists.txt b/src/app/qtsingleapplication/CMakeLists.txt index 30f7fabfd..6571c1f8e 100644 --- a/src/app/qtsingleapplication/CMakeLists.txt +++ b/src/app/qtsingleapplication/CMakeLists.txt @@ -20,6 +20,10 @@ add_library(qtsingleapplication ${QBT_QTSINGLEAPPLICATION_HEADERS} ${QBT_QTSINGL target_include_directories(qtsingleapplication INTERFACE "${qtsingleapplication_SOURCE_DIR}") target_link_qt_components(qtsingleapplication Network) +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + target_compile_options(qtsingleapplication PRIVATE "-w") # disable warning for 3rdparty code +endif() + if (GUI) target_link_qt_components(qtsingleapplication Widgets) endif (GUI)