From 4a0aeab5596bddf254dd1c0d3924adbddaee1a71 Mon Sep 17 00:00:00 2001 From: Neargye Date: Mon, 30 Apr 2018 08:00:05 +0500 Subject: [PATCH] update build --- .appveyor.yml | 13 ++--- .travis.yml | 136 ++++++++++++++++++++++++++++++++++++++++++++----- CMakeLists.txt | 7 ++- 3 files changed, 137 insertions(+), 19 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index e301533..6b519dc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,13 +1,12 @@ version: "{branch} #{build}" -image: Visual Studio 2017 +image: + - Visual Studio 2017 platform: - x64 - - x32 configuration: - - Release - Debug shallow_clone: true @@ -17,14 +16,16 @@ matrix: environment: matrix: - - TOOLCHAIN: msvc14 - - TOOLCHAIN: msvc15 + - GENERATOR: "Visual Studio 15 2017 Win64" + - GENERATOR: "Visual Studio 15 2017" + - GENERATOR: "Visual Studio 14 2015 Win64" + - GENERATOR: "Visual Studio 14 2015" before_build: - if exist build RMDIR /S /Q build - if not exist build mkdir build - cd build - - cmake .. %CMAKE_CONFIGURE_FLAGS% + - cmake .. -G "%GENERATOR%" build_script: - cmake --build . --config %CONFIGURATION% diff --git a/.travis.yml b/.travis.yml index 7fde7e9..4c221d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,25 +10,137 @@ git: matrix: fast_finish: true -os: - - linux - - osx +matrix: + include: + - os: linux + compiler: g++ + env: + - CXX_COMPILER=g++-4.8 CC_COMPILER=gcc-4.8 CONFIGURATION=Debug -compiler: - - g++ - - clang++ + - os: linux + compiler: g++ + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - CXX_COMPILER=g++-4.9 CC_COMPILER=gcc-4.9 CONFIGURATION=Debug -env: - - PLATFORM=x64 CONFIGURATION=Release - - PLATFORM=x64 CONFIGURATION=Debug + - os: linux + compiler: g++ + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + env: + - CXX_COMPILER=g++-5 CC_COMPILER=gcc-5 CONFIGURATION=Debug + + - os: linux + compiler: g++ + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - CXX_COMPILER=g++-6 CC_COMPILER=gcc-6 CONFIGURATION=Debug + + - os: linux + compiler: g++ + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - CXX_COMPILER=g++-7 CC_COMPILER=gcc-7 CONFIGURATION=Debug + + - os: linux + compiler: clang++ + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-4.0 + packages: + - clang-4.0 + env: + - CXX_COMPILER=clang++-4.0 CC_COMPILER=clang-4.0 CONFIGURATION=Debug + + - os: linux + compiler: clang++ + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-5.0 + packages: + - clang-5.0 + env: + - CXX_COMPILER=clang++-5.0 CC_COMPILER=clang-5.0 CONFIGURATION=Debug + + - os: linux + compiler: clang++ + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-6.0 + packages: + - clang-6.0 + env: + - CXX_COMPILER=clang++-6.0 CC_COMPILER=clang-6.0 CONFIGURATION=Debug + + - os: osx + compiler: clang++ + osx_image: xcode8.3 + env: + - CONFIGURATION=Debug + + - os: osx + compiler: clang++ + osx_image: xcode9.0 + env: + - CONFIGURATION=Debug + + - os: osx + compiler: clang++ + osx_image: xcode9.1 + env: + - CONFIGURATION=Debug + + - os: osx + compiler: clang++ + osx_image: xcode9.2 + env: + - CONFIGURATION=Debug + + - os: osx + compiler: clang++ + osx_image: xcode9.3 + env: + - CONFIGURATION=Debug + +install: + - | + if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then + export CXX=${CXX_COMPILER} + export CC=${CC_COMPILER} + fi script: - rm -rf build - mkdir -p build - cd build - - cmake .. -DCMAKE_BUILD_TYPE=$CONFIGURATION -DTARGET_CPU=$PLATFORM - - cmake --build . --config $CONFIGURATION - - ctest -V --output-on-failure -С $CONFIGURATION + - cmake .. -DCMAKE_BUILD_TYPE=${CONFIGURATION} + - cmake --build . --config ${CONFIGURATION} + - ctest -V --output-on-failure -С ${CONFIGURATION} notifications: email: false diff --git a/CMakeLists.txt b/CMakeLists.txt index f8152eb..c1c9382 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.2) +include(CheckCXXCompilerFlag) project(nameof) set(CMAKE_CXX_STANDARD 11) @@ -8,7 +9,11 @@ set(CMAKE_CXX_EXTENSIONS OFF) if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) add_compile_options(-Wall -Wextra -pedantic) elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - add_compile_options(/W4 /permissive-) + add_compile_options(/W4) + check_cxx_compiler_flag(/permissive HAS_PERMISSIVE_FLAG) + if(HAS_PERMISSIVE_FLAG) + add_compile_options(/permissive-) + endif() endif() add_subdirectory(example)