Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 30 additions & 9 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
os:
- Visual Studio 2017
image:
- Visual Studio 2017
# - Visual Studio 2019

platform:
- x64

configuration:
- Debug
- Release

install:
- cd C:\Tools\vcpkg
- git pull
- .\bootstrap-vcpkg.bat
- vcpkg install tl-expected catch2 nlohmann-json
- vcpkg integrate install
- cd %APPVEYOR_BUILD_FOLDER%

build_script:
- git submodule init
- git submodule update
- mkdir build
- cd build
- cmake ..
- cmake --build .
- ctest
- git submodule init
- git submodule update
- mkdir build
- cd build
- cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake
- cmake --build .
- ctest

cache: c:\Tools\vcpkg\installed\

matrix:
fast_finish: true
44 changes: 34 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ jobs:
steps:
- run:
name: Installing Dependencies
command: 'apt-get update && apt-get install -y sudo git wget ninja-build && rm -rf /var/lib/apt/lists/*'
command: |
apt-get update
apt-get install -y sudo git wget ninja-build curl unzip tar
rm -rf /var/lib/apt/lists/*
echo 'export CMAKE_BUILD_PARALLEL_LEVEL=4' >> $BASH_ENV
- run:
name: Installing GCC
command: |
Expand All @@ -18,19 +22,39 @@ jobs:
name: Install CMAKE
command: |
cd /tmp
wget "https://github.com/Kitware/CMake/releases/download/v3.13.3/cmake-3.13.3-Linux-x86_64.tar.gz"
tar -xzf cmake-3.13.3-Linux-x86_64.tar.gz
echo 'export PATH="/tmp/cmake-3.13.3-Linux-x86_64/bin:$PATH"' >> $BASH_ENV
- checkout
wget "https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2-Linux-x86_64.tar.gz"
tar -xzf cmake-3.15.2-Linux-x86_64.tar.gz
echo 'export PATH="/tmp/cmake-3.15.2-Linux-x86_64/bin:$PATH"' >> $BASH_ENV
- run:
name: Updating Submodules
command: 'git submodule init && git submodule update'
name: Installing VCPKG
command: |
cd /tmp
mkdir -p vcpkg
pushd vcpkg
git init
git remote add origin https://github.com/Microsoft/vcpkg.git
git fetch origin master
git checkout -b master origin/master
./bootstrap-vcpkg.sh
./vcpkg install tl-expected catch2 nlohmann-json
popd
- checkout
- run:
name: Creating Build Files
command: 'cmake -GNinja -H. -Bbuild'
command: |
mkdir _build
pushd _build
cmake -G Ninja -DSkyr_BUILD_TESTS=ON -DSkyr_BUILD_DOCS=OFF -DSkyr_BUILD_EXAMPLES=OFF -DCMAKE_TOOLCHAIN_FILE=/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake ..
popd
- run:
name: Creating Binary Files
command: 'cmake --build build'
command: |
pushd _build
ninja
popd
- run:
name: Running All Unit Tests
command: 'cd build && ctest'
command: |
pushd _build
ctest
popd
14 changes: 5 additions & 9 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
BasedOnStyle: Google
AccessModifierOffset: -1
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortIfStatementsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakTemplateDeclarations: true
AlwaysBreakTemplateDeclarations: Yes
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeBinaryOperators: None
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
Expand All @@ -23,16 +21,14 @@ PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerBindsToType: true
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
Standard: Auto
IndentWidth: 2
TabWidth: 4
UseTab: false
UseTab: Never
BreakBeforeBraces: Attach
IndentFunctionDeclarationAfterType: true
SpacesInParentheses: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true

3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "deps/googletest"]
path = deps/googletest
url = https://github.com/google/googletest.git
109 changes: 67 additions & 42 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,99 @@ language:
- cpp

dist:
- trusty
- xenial

#env:
# - BUILD_SHARED_LIBS="ON" CMAKE_BUILD_TYPE="Release"
# - BUILD_SHARED_LIBS="OFF" CMAKE_BUILD_TYPE="Release"
# - BUILD_SHARED_LIBS="ON" CMAKE_BUILD_TYPE="Debug"
# - BUILD_SHARED_LIBS="OFF" CMAKE_BUILD_TYPE="Debug"

#before_install:
# - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# - sudo apt-get update -qq
env:
global: DEPS_DIR="${TRAVIS_BUILD_DIR}/deps_"

matrix:
include:
# # 1/ Linux Clang Builds
# - os: linux
# compiler: clang
# addons: &clang60
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
# packages: ['clang-6.0', 'libc++-6-dev']
# env: COMPILER='clang++-6.0'

# 2/ Linux GCC Builds
- os: linux
compiler: gcc
compiler: gcc-7
addons: &gcc7
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7']
env: [COMPILER='g++-7', BUILD_FILESYSTEM_PATH_FUNCTION='OFF']
env: [COMPILER='g++-7', VCPKG_TRIPLET='x64-linux']

- os: linux
compiler: gcc
compiler: gcc-8
addons: &gcc8
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-8']
env: [COMPILER='g++-8', BUILD_FILESYSTEM_PATH_FUNCTION='ON']
env: [COMPILER='g++-8', VCPKG_TRIPLET='x64-linux']

- os: linux
compiler: gcc-9
addons: &gcc9
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9']
env: [COMPILER='g++-9', VCPKG_TRIPLET='x64-linux']

# 3/ OSX Clang Builds
- os: osx
osx_image: xcode10
compiler: clang
env: [BUILD_FILESYSTEM_PATH_FUNCTION='OFF']
# # 3/ OSX Clang Builds
# - os: osx
# osx_image: xcode10
# compiler: clang
# env: [COMPILER='clang', VCPKG_TRIPLET='x64-osx']

before_install:
- mkdir -p ${DEPS_DIR}
- pushd ${DEPS_DIR}
- echo ${TRAVIS_OS_NAME}
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
which cmake || brew install cmake
fi
- popd
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew install gcc
brew upgrade gcc
export CXX=`which g++`
else
export CXX=${COMPILER}
fi
- echo ${CXX}
- ${CXX} --version

install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps_"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.13.3/cmake-3.13.3-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
which cmake || brew install cmake
fi
- cd ${TRAVIS_BUILD_DIR}
- mkdir -p ${DEPS_DIR}/vcpkg
- pushd ${DEPS_DIR}/vcpkg
- git init
- git remote add origin https://github.com/Microsoft/vcpkg.git
- git fetch origin master
- git checkout -b master origin/master
- ${CXX} --version
- export
- ./bootstrap-vcpkg.sh
- ./vcpkg install tl-expected catch2 nlohmann-json
- popd

cache:
directories:
- ${DEPS_DIR}/vcpkg/installed

before_script:
export CXX=${COMPILER}
- export CXX=${COMPILER}

script:
- mkdir _build
- cd _build
- cmake -DSkyr_BUILD_TESTS=ON -DSkyr_BUILD_DOCS=OFF -DSkyr_BUILD_EXAMPLES=OFF -DSkyr_BUILD_FILESYSTEM_PATH_FUNCTIONS=$BUILD_FILESYSTEM_PATH_FUNCTIONS ..
- pushd _build
- cmake -DSkyr_BUILD_TESTS=ON
-DSkyr_BUILD_DOCS=OFF
-DSkyr_BUILD_EXAMPLES=OFF
-DCMAKE_TOOLCHAIN_FILE=${DEPS_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
..
- make -j 8
- make test
- popd

after_failure:
- cat Testing/Temporary/LastTest.log
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1,2] - 2019-08-16
## [1.2] - 2019-08-16

### Added
- Changed CMake scripts to make the library usable by downstream
Expand Down
20 changes: 7 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Glyn Matthews 2012-2018.
# Copyright (c) Glyn Matthews 2012-2019.
# 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)
Expand All @@ -13,15 +13,15 @@ option(Skyr_BUILD_EXAMPLES "Build the URL examples." OFF)
option(Skyr_FULL_WARNINGS "Build the library with all warnings turned on." ON)
option(Skyr_WARNINGS_AS_ERRORS "Treat warnings as errors." ON)
option(Skyr_USE_STATIC_CRT "Use static C Runtime library (/MT or MTd)." ON)
option(Skyr_BUILD_FILESYSTEM_PATH_FUNCTIONS "Build the filesystem path functions" ON)

find_package(Threads REQUIRED)
option(Skyr_BUILD_FILESYSTEM_PATH_FUNCTIONS "Build the filesystem path functions" OFF)

set(CMAKE_VERBOSE_MAKEFILE true)
set(CMAKE_CXX_STANDARD 17)

if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
find_package(Threads REQUIRED)
find_package(tl-expected CONFIG REQUIRED)

if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
if (Skyr_FULL_WARNINGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
Expand All @@ -32,7 +32,6 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)

message("C++ Flags: ${CMAKE_CXX_FLAGS} link flags: ${CMAKE_CXX_LINK_FLAGS}")
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
if (NOT Skyr_DISABLE_LIBCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
Expand All @@ -51,7 +50,7 @@ endif()

if (MSVC)
if(DEFINED MSVC_VERSION AND MSVC_VERSION LESS 1900)
message(FATAL_ERROR "Requires VS 2015 or later")
message(FATAL_ERROR "Requires VS 2017 or later")
endif()

if (Skyr_USE_STATIC_CRT)
Expand All @@ -76,11 +75,6 @@ add_subdirectory(src)
if (Skyr_BUILD_TESTS)
message(STATUS "Configuring tests")
enable_testing()
set(BUILD_GMOCK OFF)
set(BUILD_GTEST ON)
set(INSTALL_GMOCK OFF)
set(INSTALL_GTEST OFF)
add_subdirectory(deps/googletest)
add_subdirectory(tests)
endif()

Expand Down
Loading