Skip to content

Commit

Permalink
Merge pull request #153 from stlab/develop
Browse files Browse the repository at this point in the history
Release merge into master
  • Loading branch information
FelixPetriconi authored Jun 15, 2018
2 parents a5c524e + b779742 commit b17593c
Show file tree
Hide file tree
Showing 61 changed files with 5,943 additions and 4,737 deletions.
33 changes: 19 additions & 14 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@

shallow_clone: true

os:
- Visual Studio 2015
image:
- Visual Studio 2017

build:
verbosity: detailed

configuration:
- Debug
platform:
- x64

branches:
except:
Expand All @@ -29,21 +31,24 @@ install:
############################################################################
# Install a recent CMake
############################################################################
- set CMAKE_URL="https://cmake.org/files/v3.8/cmake-3.8.0-win64-x64.zip"
- appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
- 7z x cmake.zip -oC:\projects\deps > nul
- move C:\projects\deps\cmake-* C:\projects\deps\cmake # Move to a version-agnostic directory
- set PATH=C:\projects\deps\cmake\bin;%PATH%
# - set CMAKE_URL="https://cmake.org/files/v3.8/cmake-3.8.0-win64-x64.zip"
# - appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
# - 7z x cmake.zip -oC:\projects\deps > nul
# - move C:\projects\deps\cmake-* C:\projects\deps\cmake # Move to a version-agnostic directory
# - set PATH=C:\projects\deps\cmake\bin;%PATH%
- cmake --version

before_build:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- cd C:\projects\libraries

build_script:
- MKDIR build_debug
- cd build_debug
- cmake -G "Visual Studio 14 Win64" -DBOOST_ROOT=C:/Libraries/boost_1_60_0 -D CMAKE_BUILD_TYPE=debug -D stlab_testing=ON ..
- cd C:\projects\libraries
- IF EXIST build RMDIR /S /Q build
- MKDIR build
- cd build
- cmake -G "Visual Studio 15 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D stlab_testing=ON -D coroutine=ON ..
- cmake --build .
- test\Debug\stlab.test.channel.test --log_level=message
- test\Debug\stlab.test.cow.test --log_level=message
- test\Debug\stlab.test.future.test --log_level=message
- test\Debug\stlab.test.serial_queue.test.exe
- test\Debug\stlab.test.task.test --log_level=message
- test\Debug\stlab.test.tuple.test --log_level=message

26 changes: 21 additions & 5 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
Expand All @@ -33,19 +33,24 @@ BinPackParameters: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
# IndentBraces: false
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
BreakBeforeInheritanceComma: true # ??? (wasn't in PIE)
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Expand All @@ -54,16 +59,21 @@ DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: true
IndentPPDirectives: None # Other option is AfterHash, which indents top level includes as well
IndentWidth: 4
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
Expand All @@ -76,15 +86,21 @@ NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Left
RawStringFormats:
- Delimiter: pb
Language: TextProto
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
Expand Down
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
# cmake build directory
build/

# clion build directory
clion_build/

.idea
cmake-build-debug
cmake-build-release
.vscode
cmake-*
clion_*


71 changes: 54 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: required
dist: trusty
group: deprecated-2017Q4
#group: deprecated-2017Q4
language: cpp

cache:
Expand All @@ -13,39 +13,41 @@ addons:
- sourceline: "deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.8 main"
key_url : "http://apt.llvm.org/llvm-snapshot.gpg.key"
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
# - george-edison55-precise-backports
packages:
- g++-5
- clang-3.8
- cmake
- cmake-data

branches:
except: /pr\/.*/

before_install:
- pip install --user conan

script:
- .travis/build.sh

matrix:
include:
#
# Mac Clang, Debug & Release
#
- os: osx
compiler: clang
osx_image: xcode8
before_install: pip install conan
osx_image: xcode9
before_install:
- brew update
- brew upgrade python
- pip3 install conan
- ./enhance_conan.sh

env:
build_type=debug
options="-D stlab_testing=ON"

- os: osx
compiler: clang
osx_image: xcode8
before_install: pip install conan
osx_image: xcode9
before_install:
- brew update
- brew upgrade python
- pip3 install conan
- ./enhance_conan.sh

env:
build_type=release
options="-D stlab_testing=ON"
Expand Down Expand Up @@ -136,19 +138,18 @@ matrix:
options="-D stlab_testing=ON"
before_install:
- pip install --user conan
- ./enhance_conan.sh
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
addons:
apt:
sources:
- sourceline: "deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.8 main"
key_url : "http://apt.llvm.org/llvm-snapshot.gpg.key"
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
# - george-edison55-precise-backports
packages:
- g++-5
- clang-3.8
- cmake
- cmake-data
coverity_scan:
project:
name: "stlab/libraries"
Expand All @@ -158,6 +159,42 @@ matrix:
build_command: ".travis/build.sh"
branch_pattern: coverity


before_install:
- pip install --user conan
- ./enhance_conan.sh


install:
############################################################################
# All the dependencies are installed in ${HOME}/deps/
############################################################################
- DEPS_DIR="${HOME}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}

############################################################################
# Install a recent CMake
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.10/cmake-3.10.0-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}
else
brew install cmake || brew upgrade cmake
fi
- cmake --version

############################################################################
# Go back to the root of the project and setup the build directory
############################################################################
- cd "${TRAVIS_BUILD_DIR}"


script:
- .travis/build.sh


notifications:
recipients:
- [email protected]
Expand Down
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v1.2.0 - 15 June 2018

- Fixed Issues
- [#146](https://github.com/stlab/libraries/issues/146) : when_all() does not compile with move-only objects
- [#142](https://github.com/stlab/libraries/issues/142) : boost/variant.hpp: No such file or directory
- [#119](https://github.com/stlab/libraries/issues/119) : blocking_get randomly does not return
- Library Additions
- Concurrency Library
- Adding usage of std::optional, std::variant or std::experimental::optional when compiling with C++17 mode. So the dependency to boost.optional is optional.
- Adding co-routine support for futures. (Only for VS 2017 and clang 5.0)
- Adding main_executor for Qt support

## v1.1.1 - 13 December 2017

- Fixed Issues
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ target_sources( stlab INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/future.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/immediate_executor.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/main_executor.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/optional.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/progress.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/system_timer.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/task.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/traits.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/tuple_algorithm.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/utility.hpp" )
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/utility.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/variant.hpp")

set( flags "${CMAKE_CURRENT_SOURCE_DIR}/cmake/${CMAKE_CXX_COMPILER_ID}.cmake" )
if( EXISTS ${flags} )
Expand Down
36 changes: 36 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Software Technology Lab Concurrency Library

## Requirements
* C++ 14 compatible compiler
* Visual Studio 2015 Update 5 or later
* Clang 3.8 or later
* GCC 4.8.5 or later

* boost.optional, boost.variant (only for C++14, see below for further details)
* boost.test (only for the unit tests)

## Configuration Options
The concurrency library is a header only library. Add ./ to the include path.
It is necessary to add the compiler flag -fpermissive for all gcc versions < 7,
because of a gcc bug. The compiler complains about a static constexpr statement
in the `stlab::task class`. It accepts the code with the -fpermissive flag, but
the compiler produces a huge ammount of warnings, that can only be silenced with
-w flag.

The library uses per default boost::optional and boost::variant.

Under certain conditions, it uses different implementations for optional in the following order:
* boost::optional, if the define STLAB_FORCE_BOOST_OPTIONAL is set, or
* std::optional, if C++17 is enabled and std::optional is available, or
* std::experimental::optional, if it is available, otherwise
* boost::optional

Under certain conditions, it uses different implementations for variant in the following order:
* boost::variant, if the define STLAB_FORCE_BOOST_VARIANT is set, or
* std::variant, if C++17 is enabled and std::variant is available, or
* boost::variant





4 changes: 3 additions & 1 deletion cmake/Clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ set( stlab_base_flags "-Wall;-ftemplate-backtrace-limit=0;" )
set( stlab_debug_flags "-gdwarf-3;" )
set( stlab_coverage_flags "-fprofile-arcs;-ftest-coverage;" )
set( stlab_release_flags "" )
set( stlab_interface_flags "-std=c++14;")
set( stlab_interface_flags "-std=c++latest;-DBOOST_NO_AUTO_PTR=1;")
set( stlab_coroutine_flags "-fcoroutines-ts;")

5 changes: 4 additions & 1 deletion cmake/GNU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ set( stlab_base_flags "-Wall;-ftemplate-backtrace-limit=0;" )
set( stlab_debug_flags "-gdwarf-3;" )
set( stlab_coverage_flags "-fprofile-arcs;-ftest-coverage;" )
set( stlab_release_flags "" )
set( stlab_interface_flags "-std=c++14;")
# gcc version < 7 has a bug in static constexpr members and reports tons of errors/warnings.
# By using -fpermissive and -w is the only way to shut the compiler up
# Remove when we remove to C++17
set( stlab_interface_flags "-std=gnu++14;-fpermissive;-w")
3 changes: 2 additions & 1 deletion cmake/MSVC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ set( stlab_base_flags "" ) # removed /EHsc
set( stlab_debug_flags "" )
set( stlab_coverage_flags "" )
set( stlab_release_flags "" )
set( stlab_interface_flags "-D_WIN32_WINNT=0x0601" "-DNOMINMAX")
set( stlab_interface_flags "-D_WIN32_WINNT=0x0601;/DNOMINMAX;/std:c++latest;/D_HAS_AUTO_PTR_ETC=1;/bigobj;/D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING")
set( stlab_coroutine_flags "/std:c++latest;/await;")
Loading

0 comments on commit b17593c

Please sign in to comment.