From ce31cf531d85ad4a35cd0d71fecd13cd48ada890 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Tue, 6 Feb 2018 12:25:39 +0000 Subject: [PATCH] CI: Update to C++17 and use Ubuntu 18.04 as baseline --- .travis/linux-frozen/build.sh | 4 ++-- .travis/linux-frozen/docker.sh | 16 ++++++++-------- .travis/linux-frozen/install_package.py | 2 +- .travis/linux/build.sh | 2 +- .travis/linux/deps.sh | 2 +- .travis/linux/docker.sh | 6 +++--- .travis/macos/build.sh | 2 +- CMakeLists.txt | 9 +++++---- externals/boost | 2 +- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.travis/linux-frozen/build.sh b/.travis/linux-frozen/build.sh index 25fa0259e..873b6fb53 100755 --- a/.travis/linux-frozen/build.sh +++ b/.travis/linux-frozen/build.sh @@ -1,4 +1,4 @@ #!/bin/bash -ex -docker pull ubuntu:16.04 -docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra ubuntu:16.04 /bin/bash -ex /citra/.travis/linux-frozen/docker.sh +docker pull ubuntu:18.04 +docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra ubuntu:18.04 /bin/bash -ex /citra/.travis/linux-frozen/docker.sh diff --git a/.travis/linux-frozen/docker.sh b/.travis/linux-frozen/docker.sh index f5cb1b0c0..659277870 100755 --- a/.travis/linux-frozen/docker.sh +++ b/.travis/linux-frozen/docker.sh @@ -9,16 +9,16 @@ apt-get install -y build-essential wget git python-launchpadlib libssl-dev # The apt repositories remove older versions regularly, so we can't use # apt-get and have to pull the packages directly from the archives. /citra/.travis/linux-frozen/install_package.py \ - libsdl2-dev 2.0.4+dfsg1-2ubuntu2 xenial \ - qtbase5-dev 5.2.1+dfsg-1ubuntu14.3 trusty \ - libqt5opengl5-dev 5.2.1+dfsg-1ubuntu14.3 trusty \ - libcurl4-openssl-dev 7.47.0-1ubuntu2.3 xenial \ - libicu52 52.1-3ubuntu0.6 trusty + libsdl2-dev 2.0.7+dfsg1-3ubuntu1 bionic \ + qtbase5-dev 5.9.3+dfsg-0ubuntu2 bionic \ + libqt5opengl5-dev 5.9.3+dfsg-0ubuntu2 bionic \ + libcurl4-openssl-dev 7.58.0-2ubuntu1 bionic \ + libicu57 57.1-6ubuntu0.2 bionic # Get a recent version of CMake -wget https://cmake.org/files/v3.9/cmake-3.9.0-Linux-x86_64.sh -echo y | sh cmake-3.9.0-Linux-x86_64.sh --prefix=cmake -export PATH=/citra/cmake/cmake-3.9.0-Linux-x86_64/bin:$PATH +wget https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.sh +echo y | sh cmake-3.10.1-Linux-x86_64.sh --prefix=cmake +export PATH=/citra/cmake/cmake-3.10.1-Linux-x86_64/bin:$PATH mkdir build && cd build cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_BUILD_TYPE=Release -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} diff --git a/.travis/linux-frozen/install_package.py b/.travis/linux-frozen/install_package.py index bdf333716..9837f347a 100755 --- a/.travis/linux-frozen/install_package.py +++ b/.travis/linux-frozen/install_package.py @@ -35,4 +35,4 @@ def get_package(pkg, distro): for i in xrange(1, len(sys.argv), 3): get_package([sys.argv[i], sys.argv[i + 1]], sys.argv[i + 2]) -subprocess.check_call(['apt-get', 'install', '-y'] + deb_file_list) +subprocess.check_call(['apt-get', 'install', '-y', '--force-yes'] + deb_file_list) diff --git a/.travis/linux/build.sh b/.travis/linux/build.sh index 3e7b212f4..6031fb7ac 100755 --- a/.travis/linux/build.sh +++ b/.travis/linux/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -ex -docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra ubuntu:16.04 /bin/bash -ex /citra/.travis/linux/docker.sh +docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra ubuntu:18.04 /bin/bash -ex /citra/.travis/linux/docker.sh diff --git a/.travis/linux/deps.sh b/.travis/linux/deps.sh index be3f6bece..540bb934a 100755 --- a/.travis/linux/deps.sh +++ b/.travis/linux/deps.sh @@ -1,3 +1,3 @@ #!/bin/sh -ex -docker pull ubuntu:16.04 +docker pull ubuntu:18.04 diff --git a/.travis/linux/docker.sh b/.travis/linux/docker.sh index 1a5197555..5cbf58067 100755 --- a/.travis/linux/docker.sh +++ b/.travis/linux/docker.sh @@ -6,9 +6,9 @@ apt-get update apt-get install -y build-essential libsdl2-dev qtbase5-dev libqt5opengl5-dev qttools5-dev qttools5-dev-tools libcurl4-openssl-dev libssl-dev wget git # Get a recent version of CMake -wget https://cmake.org/files/v3.9/cmake-3.9.0-Linux-x86_64.sh -echo y | sh cmake-3.9.0-Linux-x86_64.sh --prefix=cmake -export PATH=/citra/cmake/cmake-3.9.0-Linux-x86_64/bin:$PATH +wget https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.sh +echo y | sh cmake-3.10.1-Linux-x86_64.sh --prefix=cmake +export PATH=/citra/cmake/cmake-3.10.1-Linux-x86_64/bin:$PATH mkdir build && cd build cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} diff --git a/.travis/macos/build.sh b/.travis/macos/build.sh index 25a4d4d5b..83513d922 100755 --- a/.travis/macos/build.sh +++ b/.travis/macos/build.sh @@ -2,7 +2,7 @@ set -o pipefail -export MACOSX_DEPLOYMENT_TARGET=10.9 +export MACOSX_DEPLOYMENT_TARGET=10.12 export Qt5_DIR=$(brew --prefix)/opt/qt5 mkdir build && cd build diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b00aa770..1cf929780 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -# CMake 3.6 required for FindBoost to define IMPORTED libs properly on unknown Boost versions -cmake_minimum_required(VERSION 3.6) +# CMake 3.8 required for 17 to be a valid value for CXX_STANDARD +cmake_minimum_required(VERSION 3.8) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") include(DownloadExternals) @@ -89,7 +89,7 @@ message(STATUS "Target architecture: ${ARCHITECTURE}") # Configure compilation flags # =========================== -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if (NOT MSVC) @@ -129,9 +129,10 @@ else() # /permissive- - enables stricter C++ standards conformance checks set(CMAKE_C_FLAGS "/W3 /MP /Zi /Zo /permissive-" CACHE STRING "" FORCE) # /EHsc - C++-only exception handling semantics + # /std:c++latest - Latest available C++ standard # /Zc:throwingNew - let codegen assume `operator new` will never return null # /Zc:inline - let codegen omit inline functions in object files - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /EHsc /Zc:throwingNew,inline" CACHE STRING "" FORCE) + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /EHsc /std:c++latest /Zc:throwingNew,inline" CACHE STRING "" FORCE) # /MDd - Multi-threaded Debug Runtime DLL set(CMAKE_C_FLAGS_DEBUG "/Od /MDd" CACHE STRING "" FORCE) diff --git a/externals/boost b/externals/boost index 3abc84aba..7310c95e2 160000 --- a/externals/boost +++ b/externals/boost @@ -1 +1 @@ -Subproject commit 3abc84abaf63a068cb59a9f9b5675c1947bc6fd9 +Subproject commit 7310c95e2320ed262b0600315fa2f762c4b6cc54