From 85e33cd1380aafb909469c7bf1c9e3007fa77486 Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Tue, 18 Sep 2018 13:16:45 +0200 Subject: [PATCH 1/3] [CMake] Generate cmake target that other libraries can use ... to express their dependency on this library and retrieve any configuration information such as the include directory, binary to link to (if any), transitive dependencies, necessary compiler options or the required c++ standards level. --- CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..cedb5a1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright 2018 Mike Dev +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt + +cmake_minimum_required(VERSION 3.5) +project(boost-array LANGUAGES CXX) + +add_library(boost_array INTERFACE) +add_library(Boost::array ALIAS boost_array) + +target_include_directories(boost_array INTERFACE include) + +target_link_libraries(boost_array + INTERFACE + Boost::assert + Boost::config + Boost::core + Boost::static_assert + Boost::throw_exception +) + From e5f4af3dd212608f6a4a639a82f3484234807eec Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Fri, 7 Dec 2018 11:21:51 +0100 Subject: [PATCH 2/3] [CMake] Add self-test for cmake --- CMakeLists.txt | 3 +++ test/test_cmake/CMakeLists.txt | 22 ++++++++++++++++++++++ test/test_cmake/main.cpp | 5 +++++ 3 files changed, 30 insertions(+) create mode 100644 test/test_cmake/CMakeLists.txt create mode 100644 test/test_cmake/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index cedb5a1..9c7c145 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,9 @@ # Distributed under the Boost Software License, Version 1.0. # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt +# NOTE: CMake support for Boost.Array is currently experimental at best +# and the interface is likely to change in the future + cmake_minimum_required(VERSION 3.5) project(boost-array LANGUAGES CXX) diff --git a/test/test_cmake/CMakeLists.txt b/test/test_cmake/CMakeLists.txt new file mode 100644 index 0000000..d1bce85 --- /dev/null +++ b/test/test_cmake/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright 2018 Mike Dev +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt +# +# NOTE: This does NOT run the unit tests for Boost.Array. +# It only tests, if the CMakeLists.txt file in it's root works as expected + +cmake_minimum_required( VERSION 3.5 ) + +project( BoostBindCMakeSelfTest ) + +add_subdirectory( ../../../assert ${CMAKE_CURRENT_BINARY_DIR}/libs/assert ) +add_subdirectory( ../../../config ${CMAKE_CURRENT_BINARY_DIR}/libs/config ) +add_subdirectory( ../../../core ${CMAKE_CURRENT_BINARY_DIR}/libs/core ) +add_subdirectory( ../../../static_assert ${CMAKE_CURRENT_BINARY_DIR}/libs/static_assert ) +add_subdirectory( ../../../throw_exception ${CMAKE_CURRENT_BINARY_DIR}/libs/thorw_exception ) + +add_subdirectory( ../.. ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_array ) + +add_executable( boost_array_cmake_self_test main.cpp ) +target_link_libraries( boost_array_cmake_self_test Boost::array ) + diff --git a/test/test_cmake/main.cpp b/test/test_cmake/main.cpp new file mode 100644 index 0000000..c2e0c90 --- /dev/null +++ b/test/test_cmake/main.cpp @@ -0,0 +1,5 @@ +#include + +int main() { + boost::array a{}; +} \ No newline at end of file From ee03e0bae868b8d526dc6ddcc007cdf3389216b4 Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Fri, 7 Dec 2018 11:27:35 +0100 Subject: [PATCH 3/3] [CI] Add travis file --- .travis.yml | 217 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f397fc5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,217 @@ +# Copyright 2016, 2017 Peter Dimov +# Copyright 2018, Mike-Dev +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + +language: cpp + +sudo: false + +python: "2.7" + +branches: + only: + - master + - develop + - /feature\/.*/ + +env: + matrix: + - BOGUS_JOB=true + +matrix: + + exclude: + - env: BOGUS_JOB=true + + include: + + # cmake self-test + - os: linux + env: TEST_CMAKE=TRUE #Only for easier identification in travis web gui + install: + - BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true + - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/assert.git ../assert + - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/config.git ../config + - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/core.git ../core + - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/static_assert.git ../static_assert + - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/throw_exception.git ../throw_exception + + script: + - mkdir __build__ && cd __build__ + - cmake ../test/test_cmake + - cmake --build . + + - os: linux + compiler: g++ + env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11 + + - os: linux + compiler: g++-4.7 + env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 + addons: + apt: + packages: + - g++-4.7 + sources: + - ubuntu-toolchain-r-test + + - os: linux + compiler: g++-4.8 + env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11 + addons: + apt: + packages: + - g++-4.8 + sources: + - ubuntu-toolchain-r-test + - os: linux + compiler: g++-4.9 + env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11 + addons: + apt: + packages: + - g++-4.9 + sources: + - ubuntu-toolchain-r-test + + - os: linux + compiler: g++-5 + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - g++-5 + sources: + - ubuntu-toolchain-r-test + + - os: linux + compiler: g++-6 + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - g++-6 + sources: + - ubuntu-toolchain-r-test + + - os: linux + dist: trusty + compiler: g++-7 + env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 + addons: + apt: + packages: + - g++-7 + sources: + - ubuntu-toolchain-r-test + + - os: linux + compiler: clang++ + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 + + - os: linux + compiler: clang++-3.5 + env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-3.5 + - libstdc++-4.9-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.5 + + - os: linux + compiler: clang++-3.6 + env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-3.6 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + + - os: linux + compiler: clang++-3.7 + env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-3.7 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 + + - os: linux + compiler: clang++-3.8 + env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-3.8 + - libstdc++-4.9-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + + - os: linux + compiler: clang++-3.9 + env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-3.9 + - libstdc++-4.9-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.9 + + - os: linux + compiler: clang++-4.0 + env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-4.0 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-4.0 + + - os: linux + compiler: clang++-5.0 + env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-5.0 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-5.0 + + - os: osx + compiler: clang++ + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + +install: + - BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true + - cd .. + - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + - cd boost-root + - git submodule update --init tools/build + - git submodule update --init libs/config + - git submodule update --init tools/boostdep + - cp -r $TRAVIS_BUILD_DIR/* libs/array + - python tools/boostdep/depinst/depinst.py array + - ./bootstrap.sh + - ./b2 headers + +script: + - |- + echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam + - ./b2 -j 3 libs/array/test toolset=$TOOLSET cxxstd=$CXXSTD + +notifications: + email: + on_success: always