From b9f3e4d58559689ea0621c411deac80016c04f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Mon, 20 Jun 2016 13:12:01 +0200 Subject: [PATCH] Switch to Ubuntu 14.04 Trusty VM : CMake 2.8.12 with add_compile_options() --- .travis.yml | 4 +++- CMakeLists.txt | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 72ba3c1..ab85880 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,9 @@ compiler: - gcc - clang -sudo: false +# request for Ubuntu 14.04 Trusty VM +sudo: true +dist: trusty addons: apt: diff --git a/CMakeLists.txt b/CMakeLists.txt index 535ffef..e4f05ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # # Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt # or copy at http://opensource.org/licenses/MIT) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) # first version with add_compile_options() project(SQLiteCpp) # Define useful variables to handle OS differences: @@ -29,8 +29,7 @@ else (MSVC) set(CPPLINT_ARG_OUTPUT "--output=eclipse") set(CPPCHECK_ARG_TEMPLATE "--template=gcc") # Useful compile flags and extra warnings - #add_compile_options() is not supported with CMake 2.8.7 of Ubuntu 12.04 on Travis-CI - add_definitions(-fstack-protector -Wall -Winit-self -Wswitch-enum -Wshadow -Winline) + add_compile_options(-fstack-protector -Wall -Winit-self -Wswitch-enum -Wshadow -Winline) if (CMAKE_COMPILER_IS_GNUCXX) # GCC flags if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX) @@ -39,7 +38,7 @@ else (MSVC) else () message (WARNING "GCov instrumentation works best in Debug mode") endif () - add_definitions (-fprofile-arcs -ftest-coverage) + add_compile_options (-fprofile-arcs -ftest-coverage) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") endif () endif (CMAKE_COMPILER_IS_GNUCXX) @@ -220,7 +219,7 @@ option(SQLITECPP_BUILD_TESTS "Build and run tests." OFF) if (SQLITECPP_BUILD_TESTS) # deactivate some warnings for compiling the gtest library if (NOT MSVC) - add_definitions(-Wno-variadic-macros -Wno-long-long -Wno-switch-enum -Wno-float-equal -Wno-conversion-null -Wno-switch-default -Wno-pedantic) + add_compile_options(-Wno-variadic-macros -Wno-long-long -Wno-switch-enum -Wno-float-equal -Wno-conversion-null -Wno-switch-default -Wno-pedantic) endif (NOT MSVC) # add the subdirectory containing the CMakeLists.txt for the gtest library