From 973c5897e5d17e0dab639cc4d02367777973aa1b Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Thu, 3 May 2018 12:04:43 +0200 Subject: [PATCH] testing travis-ci #6 --- .travis.yml | 41 ++++++++++++++--------------------------- CMakeLists.txt | 24 ++++++++++++------------ 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac1e207..32cafe0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,33 +1,20 @@ +sudo: false language: cpp +compiler: clang os: linux dist: trusty matrix: - include: - - env: - - CC=clang-5.0 - CXX=clang++-5.0 - BUILD_TYPE=Release - BIN_DIR=bin - addons: &clang40 - apt: - packages: - - g++-5 - - clang-5.0 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-trusty-5.0 - - sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - env: - - CC=clang-5.0 - - CXX=clang++-5.0 - - BUILD_TYPE=Release - - BIN_DIR=bin - addons: *clang40 + include: + - script: + - cd build + - cmake -DCMAKE_BUILD_TYPE=Debug .. + - make -j + - script: + - cd build + - cmake -DCMAKE_BUILD_TYPE=Release .. + - make -j -script: - - cd build - - cmake -DCMAKE_BUILD_TYPE=$BUILD .. - - make -j - - ../$BINDIR/projet_lzw -c -i ../$BINDIR/projet_lzw +notifications: + email: + - phundrak@phundrak.fr diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cfe5ab..ca48bf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,24 +8,24 @@ set(TGT "projet_lzw") set(${TGT}_VERSION_MAJOR 0) set(${TGT}_VERSION_MINOR 1) -set(CXX_COVERAGE_COMPILE_FLAGS "-pedantic -Wall -Wextra -Wold-style-cast -Woverloaded-virtual -Wfloat-equal -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wsign-conversion -Wshadow -Weffc++ -Wredundant-decls -Wdouble-promotion -Winit-self -Wswitch-default -Wswitch-enum -Wundef -Winline -Wunused -Wnon-virtual-dtor -pthread") +set(CXX_COVERAGE_COMPILE_FLAGS "-std=c++1z -pedantic -Wall -Wextra -Wold-style-cast -Woverloaded-virtual -Wfloat-equal -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wsign-conversion -Wshadow -Weffc++ -Wredundant-decls -Wdouble-promotion -Winit-self -Wswitch-default -Wswitch-enum -Wundef -Winline -Wunused -Wnon-virtual-dtor -pthread") set(CMAKE_CXX_FLAGS_DEBUG "${CXX_COVERAGE_COMPILE_FLAGS} -DDebug -g -pg") set(CMAKE_CXX_FLAGS_RELEASE "${CXX_COVERAGE_COMPILE_FLAGS} -O3") include(CheckCXXCompilerFlag) # Check for standard to use -check_cxx_compiler_flag(-std=c++17 HAVE_FLAG_STD_CXX17) -if(HAVE_FLAG_STD_CXX17) - set(CMAKE_CXX_STANDARD 17) -else() - check_cxx_compiler_flag(-std=c++1z HAVE_FLAG_STD_CXX1Z) - if(HAVE_FLAG_STD_CXX1Z) - set(CXX_COVERAGE_COMPILE_FLAGS "${CXX_COVERAGE_COMPILE_FLAGS} -std=c++1z") - else() - message( FATAL_ERROR "C++17 not supported, CMake will exit." ) - endif() -endif() +#check_cxx_compiler_flag(-std=c++17 HAVE_FLAG_STD_CXX17) +#if(HAVE_FLAG_STD_CXX17) +# set(CMAKE_CXX_STANDARD 17) +#else() +# check_cxx_compiler_flag(-std=c++1z HAVE_FLAG_STD_CXX1Z) +# if(HAVE_FLAG_STD_CXX1Z) +# set(CXX_COVERAGE_COMPILE_FLAGS "${CXX_COVERAGE_COMPILE_FLAGS} -std=c++1z") +# else() +# message( FATAL_ERROR "C++17 not supported, CMake will exit." ) +# endif() +#endif() # set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED YES)