From 17ebd59fd1e890368c0398c5a5d24e8327c01898 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Tue, 7 Aug 2018 21:54:48 -0600 Subject: [PATCH 01/61] modernize cmake --- CMakeLists.txt | 163 +++++++++++++++++------- cmake/stlab.cmake | 13 ++ cmake/stlabConfig.cmake | 3 + src/CMakeLists.txt | 22 ---- test/CMakeLists.txt | 274 +++++++--------------------------------- 5 files changed, 177 insertions(+), 298 deletions(-) create mode 100644 cmake/stlab.cmake create mode 100644 cmake/stlabConfig.cmake delete mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 16a1970d4..a2f69dd09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,61 +1,128 @@ -cmake_minimum_required( VERSION 3.2 ) -set( CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Supported configuration types" FORCE ) +cmake_minimum_required( VERSION 3.5 ) -project( stlab LANGUAGES C CXX ) +if( DEFINED PROJECT_NAME ) + set( root OFF ) + set( subproject ON ) +else() + set( root ON ) + set( subproject OFF ) +endif() -option( coverage "Enable binary instrumentation to collect test coverage information in the DEBUG configuration" ) -option( stlab_testing "Compile the stlab tests and integrate with ctest" ${BUILD_TESTING} ) +project( stlab VERSION 1.0 LANGUAGES C CXX ) -set( Boost_MULTITHREADED ON ) -set( Boost_USE_STATIC_LIBS ON ) +include( CTest ) +include( CMakeDependentOption ) +include( CMakePackageConfigHelpers ) -if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) - include( ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) - set( CONAN_SYSTEM_INCLUDES ON ) - conan_basic_setup() -else() - find_package( Boost 1.60.0 COMPONENTS unit_test_framework) -endif() +cmake_dependent_option( stlab.testing + "Compile the stlab tests and integrate with ctest" + ON "root;BUILD_TESTING" OFF ) -set( CMAKE_THREAD_PREFER_PTHREAD TRUE ) -find_package( Threads ) +cmake_dependent_option( stlab.coverage + "Enable binary instrumentation to collect test coverage information in the DEBUG configuration" + OFF "root" OFF ) + +option( stlab.coroutines "Integrate the C++17 coroutines TS in stlab" OFF ) +mark_as_advanced( stlab.coroutines ) add_library( stlab INTERFACE ) +add_library( stlab::stlab ALIAS stlab ) -target_include_directories( stlab INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}" - INTERFACE "${Boost_INCLUDE_DIRS}" ) +target_compile_features( stlab INTERFACE cxx_std_14 ) +target_include_directories( stlab INTERFACE + $ + $ ) + +set( CMAKE_THREAD_PREFER_PTHREAD TRUE ) +find_package( Threads REQUIRED ) +target_link_libraries( stlab INTERFACE Threads::Threads) -target_link_libraries( stlab INTERFACE ${CMAKE_THREAD_LIBS_INIT} - INTERFACE ${CONAN_LIBS} ) - target_sources( stlab INTERFACE - "${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/channel.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/config.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/default_executor.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/stlab/concurrency/executor_base.hpp" - "${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/variant.hpp") - -set( flags "${CMAKE_CURRENT_SOURCE_DIR}/cmake/${CMAKE_CXX_COMPILER_ID}.cmake" ) -if( EXISTS ${flags} ) - include( ${flags} ) -else() - message( WARNING "No stlab-defined flags for ${CMAKE_CXX_COMPILER_ID} C++ compiler") - message( STATUS "Only CMake defaults will be used") -endif() -target_compile_options( stlab INTERFACE ${stlab_interface_flags} ) - -if ( stlab_testing ) - enable_testing() + $ + $ ) + +if ( stlab.testing ) +# list( APPEND CMAKE_MODULE_DIR "${stlab_SOURCE_DIR}/cmake" ) +# include( development ) + + find_package( Boost 1.60.0 REQUIRED COMPONENTS unit_test_framework ) + add_library( testing INTERFACE ) + target_link_libraries( testing INTERFACE + Boost::unit_test_framework +# stlab::development + stlab::stlab ) + + get_target_property(var Boost::unit_test_framework TYPE) + target_compile_definitions( testing INTERFACE + $<$>:BOOST_TEST_DYN_LINK> ) + + set_target_properties( testing PROPERTIES + INTERFACE_COROUTINES ${stlab.coroutines} + INTERFACE_CXX_EXTENSIONS OFF ) + + set_property( TARGET testing APPEND PROPERTY + COMPATIBLE_INTERFACE_BOOL INTERFACE_COROUTINES) + + add_library( stlab::testing ALIAS testing ) + add_subdirectory( test ) endif() +write_basic_package_version_file( + "${stlab_BINARY_DIR}/stlabConfigVersion.cmake" + VERSION ${stlab_VERSION} + COMPATIBILITY SameMajorVersion ) + +install( TARGETS stlab + EXPORT stlabTargets + BUNDLE DESTINATION bin COMPONENT Runtime + RUNTIME DESTINATION bin COMPONENT Runtime + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + PUBLIC_HEADER DESTINATION include COMPONENT Development ) + +install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/stlab + DESTINATION include + USE_SOURCE_PERMISSIONS + FILES_MATCHING PATTERN "*.hpp") + +install( EXPORT stlabTargets + FILE stlabTargets.cmake + NAMESPACE stlab:: + DESTINATION share/cmake/stlab ) + +install( FILES + "${stlab_SOURCE_DIR}/cmake/stlabConfig.cmake" + "${stlab_BINARY_DIR}/stlabConfigVersion.cmake" + DESTINATION share/cmake/stlab ) + diff --git a/cmake/stlab.cmake b/cmake/stlab.cmake new file mode 100644 index 000000000..31a65f3bf --- /dev/null +++ b/cmake/stlab.cmake @@ -0,0 +1,13 @@ +if(CMAKE_VERSION VERSION_LESS "3.10") + if(DEFINED stlab.cmake) + return() + endif() + + set(stlab.cmake "" CACHE INTERNAL "") +else() + include_gaurd(GLOBAL) +endif() + +include(stlab/warnings) +include(stlab/coverage) +include(stlab/coroutines) diff --git a/cmake/stlabConfig.cmake b/cmake/stlabConfig.cmake new file mode 100644 index 000000000..d83047040 --- /dev/null +++ b/cmake/stlabConfig.cmake @@ -0,0 +1,3 @@ +include( CMakeFindDependencyMacro ) +find_dependency( Boost 1.60.0 REQUIRED COMPONENTS unit_test_framework ) +include( "${CMAKE_CURRENT_LIST_DIR}/stlabTargets.cmake" ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index c55c401ab..000000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -project(future C CXX) - -include_directories("${PROJECT_SOURCE_DIR}/..") - -#set(SOURCE -#) - -set(HEADERS - ../stlab/concurrency/channel.hpp - ../stlab/concurrency/config.hpp - ../stlab/concurrency/default_executor.hpp - ../stlab/concurrency/executor_base.hpp - ../stlab/concurrency/future.hpp - ../stlab/concurrency/immediate_executor.hpp - ../stlab/concurrency/main_executor.hpp - ../stlab/concurrency/progress.hpp - ../stlab/concurrency/system_timer.hpp - ../stlab/concurrency/traits.hpp - ../stlab/concurrency/tuple_algorithm.hpp - ../stlab/concurrency/utility.hpp) - -include_directories(${Boost_INCLUDE_DIRS}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f80a5c621..750e69d8b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,251 +1,69 @@ -#################################################################################################### - add_executable( stlab.test.channel.test - "${CMAKE_CURRENT_SOURCE_DIR}/channel_functor_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/channel_merge_round_robin_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/channel_merge_unordered_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/channel_merge_zip_with_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/channel_process_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/channel_test_helper.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/channel_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/tuple_algorithm_test.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/channel_test_helper.hpp" ) - -# This syntax is a CMake generator expression. -# -# Here we defer the compiler flags decision-making to generation time -# (for tools which support distinct configuration and generation steps) -# based on a generation time configuration. -# -# Here, we provide support for a DEBUG and RELEASE configurations, line 32 -# providing the former and line 33 providing the latter. -target_compile_options( stlab.test.channel.test - PUBLIC ${stlab_base_flags} - $<$:$<$:${stlab_coverage_flags}>${stlab_debug_flags}> - $<$:${stlab_release_flags}> - ${stlab_appended_flags} ) - -target_link_libraries( stlab.test.channel.test - PUBLIC ${Boost_LIBRARIES} - PUBLIC stlab ) - -target_link_libraries( stlab.test.channel.test PUBLIC - "${stlab_base_flags}" ) - -target_link_libraries( stlab.test.channel.test PUBLIC - "$<$:${stlab_debug_flags}>" ) - -target_link_libraries( stlab.test.channel.test PUBLIC - "$<$:$<$:${stlab_coverage_flags}>>" ) - -target_link_libraries( stlab.test.channel.test PUBLIC - "$<$:${stlab_release_flags}>" ) - -target_link_libraries( stlab.test.channel.test PUBLIC - "${stlab_appended_flags}" ) - -set_property(TARGET stlab.test.channel.test PROPERTY CXX_STANDARD 14) -set_property(TARGET stlab.test.channel.test PROPERTY CXX_STANDARD_REQUIRED ON) - + channel_functor_tests.cpp + channel_merge_round_robin_tests.cpp + channel_merge_unordered_tests.cpp + channel_merge_zip_with_tests.cpp + channel_process_tests.cpp + channel_test_helper.cpp + channel_tests.cpp + tuple_algorithm_test.cpp + main.cpp + channel_test_helper.hpp ) + +target_link_libraries( stlab.test.channel.test PUBLIC stlab::testing ) add_test( NAME stlab.test.channel COMMAND stlab.test.channel.test ) - -#################################################################################################### +################################################################################ add_executable( stlab.test.future.test - "${CMAKE_CURRENT_SOURCE_DIR}/future_coroutine_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_recover_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_test_helper.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_then_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_when_all_arguments_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_when_all_range_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_when_any_arguments_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_when_any_range_tests.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/tuple_algorithm_test.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/future_test_helper.hpp" ) - -# This syntax is a CMake generator expression. -# -# Here we defer the compiler flags decision-making to generation time -# (for tools which support distinct configuration and generation steps) -# based on a generation time configuration. -# -# Here, we provide support for a DEBUG and RELEASE configurations, line 32 -# providing the former and line 33 providing the latter. -target_compile_options( stlab.test.future.test - PUBLIC ${stlab_base_flags} - $<$:$<$:${stlab_coverage_flags}>${stlab_debug_flags}> - $<$:${stlab_coroutine_flags}> - $<$:${stlab_release_flags}> - ${stlab_appended_flags} ) - -target_link_libraries( stlab.test.future.test - PUBLIC ${Boost_LIBRARIES} - PUBLIC stlab ) - -target_link_libraries( stlab.test.future.test PUBLIC - "${stlab_base_flags}" ) - -target_link_libraries( stlab.test.future.test PUBLIC - "$<$:${stlab_debug_flags}>" ) - -target_link_libraries( stlab.test.future.test PUBLIC - "$<$:$<$:${stlab_coverage_flags}>>" ) - -target_link_libraries( stlab.test.future.test PUBLIC - "$<$:${stlab_release_flags}>" ) - -target_link_libraries( stlab.test.future.test PUBLIC - "${stlab_appended_flags}" ) - -set_property(TARGET stlab.test.future.test PROPERTY CXX_STANDARD 14) -set_property(TARGET stlab.test.future.test PROPERTY CXX_STANDARD_REQUIRED ON) - + future_coroutine_tests.cpp + future_recover_tests.cpp + future_test_helper.cpp + future_tests.cpp + future_then_tests.cpp + future_when_all_arguments_tests.cpp + future_when_all_range_tests.cpp + future_when_any_arguments_tests.cpp + future_when_any_range_tests.cpp + tuple_algorithm_test.cpp + main.cpp + future_test_helper.hpp ) + +target_link_libraries( stlab.test.future.test PUBLIC stlab::testing ) add_test( NAME stlab.test.future COMMAND stlab.test.future.test ) -#################################################################################################### +################################################################################ add_executable( stlab.test.serial_queue.test - "${CMAKE_CURRENT_SOURCE_DIR}/serial_queue_test.cpp" ) - -target_compile_options( stlab.test.serial_queue.test - PUBLIC "${stlab_base_flags}" - $<$:$<$:${stlab_coverage_flags}>${stlab_debug_flags}> - $<$:${stlab_release_flags}> - ${stlab_appended_flags} ) - -target_link_libraries( stlab.test.serial_queue.test - PUBLIC ${Boost_LIBRARIES} - PUBLIC stlab ) - -target_link_libraries( stlab.test.serial_queue.test PUBLIC - "${stlab_base_flags}" ) - -target_link_libraries( stlab.test.serial_queue.test PUBLIC - "$<$:${stlab_debug_flags}>" ) - -target_link_libraries( stlab.test.serial_queue.test PUBLIC - "$<$:$<$:${stlab_coverage_flags}>>" ) - -target_link_libraries( stlab.test.serial_queue.test PUBLIC - "$<$:${stlab_release_flags}>" ) - -target_link_libraries( stlab.test.serial_queue.test PUBLIC - "${stlab_appended_flags}" ) - -set_property(TARGET stlab.test.serial_queue.test PROPERTY CXX_STANDARD 14) -set_property(TARGET stlab.test.serial_queue.test PROPERTY CXX_STANDARD_REQUIRED ON) - -add_test( NAME stlab.test.serial_queue COMMAND stlab.test.serial_queue.test ) - -#################################################################################################### + serial_queue_test.cpp ) -add_executable( stlab.test.cow.test - "${CMAKE_CURRENT_SOURCE_DIR}/cow_test.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" ) - -target_compile_options( stlab.test.cow.test - PUBLIC "${stlab_base_flags}" - $<$:$<$:${stlab_coverage_flags}>${stlab_debug_flags}> - $<$:${stlab_release_flags}> - ${stlab_appended_flags} ) - -target_link_libraries( stlab.test.cow.test - PUBLIC ${Boost_LIBRARIES} - PUBLIC stlab ) - -target_link_libraries( stlab.test.cow.test PUBLIC - "${stlab_base_flags}" ) - -target_link_libraries( stlab.test.cow.test PUBLIC - "$<$:${stlab_debug_flags}>" ) +target_link_libraries( stlab.test.serial_queue.test PUBLIC stlab::testing ) +add_test( NAME stlab.test.serial_queue COMMAND stlab.test.serial_queue.test ) -target_link_libraries( stlab.test.cow.test PUBLIC - "$<$:$<$:${stlab_coverage_flags}>>" ) +################################################################################ -target_link_libraries( stlab.test.cow.test PUBLIC - "$<$:${stlab_release_flags}>" ) - -target_link_libraries( stlab.test.cow.test PUBLIC - "${stlab_appended_flags}" ) - -set_property(TARGET stlab.test.cow.test PROPERTY CXX_STANDARD 14) -set_property(TARGET stlab.test.cow.test PROPERTY CXX_STANDARD_REQUIRED ON) +add_executable( stlab.test.cow.test + cow_test.cpp + main.cpp ) +target_link_libraries( stlab.test.cow.test PUBLIC stlab::testing ) add_test( NAME stlab.test.cow COMMAND stlab.test.cow.test ) -#################################################################################################### - -add_executable( stlab.test.task.test - "${CMAKE_CURRENT_SOURCE_DIR}/task_test.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" ) +################################################################################ -target_compile_options( stlab.test.task.test - PUBLIC "${stlab_base_flags}" - $<$:$<$:${stlab_coverage_flags}>${stlab_debug_flags}> - $<$:${stlab_release_flags}> - ${stlab_appended_flags} ) - -target_link_libraries( stlab.test.task.test - PUBLIC ${Boost_LIBRARIES} - PUBLIC stlab ) - -target_link_libraries( stlab.test.task.test PUBLIC - "${stlab_base_flags}" ) - -target_link_libraries( stlab.test.task.test PUBLIC - "$<$:${stlab_debug_flags}>" ) - -target_link_libraries( stlab.test.task.test PUBLIC - "$<$:$<$:${stlab_coverage_flags}>>" ) - -target_link_libraries( stlab.test.task.test PUBLIC - "$<$:${stlab_release_flags}>" ) - -target_link_libraries( stlab.test.task.test PUBLIC - "${stlab_appended_flags}" ) - -set_property(TARGET stlab.test.task.test PROPERTY CXX_STANDARD 14) -set_property(TARGET stlab.test.task.test PROPERTY CXX_STANDARD_REQUIRED ON) +add_executable( stlab.test.task.test + task_test.cpp + main.cpp ) +target_link_libraries( stlab.test.task.test PUBLIC stlab::testing ) add_test( NAME stlab.test.task COMMAND stlab.test.task.test ) -#################################################################################################### - -add_executable( stlab.test.tuple.test - "${CMAKE_CURRENT_SOURCE_DIR}/tuple_test.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" ) - -target_compile_options( stlab.test.tuple.test - PUBLIC "${stlab_base_flags}" - $<$:$<$:${stlab_coverage_flags}>${stlab_debug_flags}> - $<$:${stlab_release_flags}> - ${stlab_appended_flags} ) - -target_link_libraries( stlab.test.tuple.test - PUBLIC ${Boost_LIBRARIES} - PUBLIC stlab ) - -target_link_libraries( stlab.test.tuple.test PUBLIC - "${stlab_base_flags}" ) - -target_link_libraries( stlab.test.tuple.test PUBLIC - "$<$:${stlab_debug_flags}>" ) - -target_link_libraries( stlab.test.tuple.test PUBLIC - "$<$:$<$:${stlab_coverage_flags}>>" ) +################################################################################ -target_link_libraries( stlab.test.tuple.test PUBLIC - "$<$:${stlab_release_flags}>" ) - -target_link_libraries( stlab.test.tuple.test PUBLIC - "${stlab_appended_flags}" ) - -set_property(TARGET stlab.test.tuple.test PROPERTY CXX_STANDARD 14) -set_property(TARGET stlab.test.tuple.test PROPERTY CXX_STANDARD_REQUIRED ON) +add_executable( stlab.test.tuple.test + tuple_test.cpp + main.cpp ) +target_link_libraries( stlab.test.tuple.test PUBLIC stlab::testing ) add_test( NAME stlab.test.tuple COMMAND stlab.test.tuple.test ) From 76f0c753781d1677e13e4631d6d5d653b70729fe Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Tue, 7 Aug 2018 22:32:24 -0600 Subject: [PATCH 02/61] reincorporated conan support --- CMakeLists.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2f69dd09..8d7b82d98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,17 +72,24 @@ target_sources( stlab INTERFACE include/stlab/concurrency/variant.hpp> ) if ( stlab.testing ) -# list( APPEND CMAKE_MODULE_DIR "${stlab_SOURCE_DIR}/cmake" ) -# include( development ) + list( APPEND CMAKE_MODULE_DIR "${stlab_SOURCE_DIR}/cmake" ) +# include( development ) + + if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) + include( conanbuildinfo.cmake ) + conan_basic_setup( TARGETS ) + add_library( Boost::unit_test_framework ALIAS CONAN_PKG::Boost ) + else() + find_package( Boost 1.60.0 REQUIRED COMPONENTS unit_test_framework ) + endif() + - find_package( Boost 1.60.0 REQUIRED COMPONENTS unit_test_framework ) add_library( testing INTERFACE ) target_link_libraries( testing INTERFACE Boost::unit_test_framework -# stlab::development +# stlab::development stlab::stlab ) - get_target_property(var Boost::unit_test_framework TYPE) target_compile_definitions( testing INTERFACE $<$>:BOOST_TEST_DYN_LINK> ) From 21d12e8bb0fafda088cd4dfabaad54fbf9226e75 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Tue, 7 Aug 2018 23:30:46 -0600 Subject: [PATCH 03/61] moved source addition to local directory --- CMakeLists.txt | 44 ++++---------------------------------- stlab/concurrency/task.hpp | 14 ++++++------ 2 files changed, 11 insertions(+), 47 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d7b82d98..8b5faf281 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,41 +35,9 @@ target_include_directories( stlab INTERFACE set( CMAKE_THREAD_PREFER_PTHREAD TRUE ) find_package( Threads REQUIRED ) -target_link_libraries( stlab INTERFACE Threads::Threads) - -target_sources( stlab INTERFACE - $ - $ ) +target_link_libraries( stlab INTERFACE Threads::Threads ) + +add_subdirectory( stlab/concurrency ) if ( stlab.testing ) list( APPEND CMAKE_MODULE_DIR "${stlab_SOURCE_DIR}/cmake" ) @@ -94,12 +62,8 @@ if ( stlab.testing ) $<$>:BOOST_TEST_DYN_LINK> ) set_target_properties( testing PROPERTIES - INTERFACE_COROUTINES ${stlab.coroutines} INTERFACE_CXX_EXTENSIONS OFF ) - set_property( TARGET testing APPEND PROPERTY - COMPATIBLE_INTERFACE_BOOL INTERFACE_COROUTINES) - add_library( stlab::testing ALIAS testing ) add_subdirectory( test ) @@ -121,7 +85,7 @@ install( TARGETS stlab install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/stlab DESTINATION include USE_SOURCE_PERMISSIONS - FILES_MATCHING PATTERN "*.hpp") + FILES_MATCHING PATTERN "*.hpp" ) install( EXPORT stlabTargets FILE stlabTargets.cmake diff --git a/stlab/concurrency/task.hpp b/stlab/concurrency/task.hpp index 9dde37290..61d0cb79b 100644 --- a/stlab/concurrency/task.hpp +++ b/stlab/concurrency/task.hpp @@ -83,8 +83,8 @@ class task { return &static_cast(self)->_f; } - static constexpr concept _vtable = {dtor, move_ctor, invoke, - target_type, pointer, const_pointer}; + static constexpr const concept _vtable = {dtor, move_ctor, invoke, + target_type, pointer, const_pointer}; F _f; }; @@ -110,8 +110,8 @@ class task { return static_cast(self)->_p.get(); } - static constexpr concept _vtable = {dtor, move_ctor, invoke, - target_type, pointer, const_pointer}; + static constexpr const concept _vtable = {dtor, move_ctor, invoke, + target_type, pointer, const_pointer}; std::unique_ptr _p; }; @@ -124,8 +124,8 @@ class task { static auto pointer(void*) noexcept -> void* { return nullptr; } static auto const_pointer(const void*) noexcept -> const void* { return nullptr; } - static constexpr concept _vtable = {dtor, move_ctor, invoke, - target_type_, pointer, const_pointer}; + static constexpr const concept _vtable = {dtor, move_ctor, invoke, + target_type_, pointer, const_pointer}; const concept* _vtable_ptr = &_vtable; @@ -213,7 +213,7 @@ class task { friend inline bool operator!=(std::nullptr_t, const task& x) { return static_cast(x); } }; -#if STLAB_CPP_VERSION < 17 +#if __cplusplus < 201703L // In C++17 constexpr implies inline and these definitions are deprecated template From 09280febebf849a44dea7fff7a1de1a25443a9de Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Tue, 7 Aug 2018 23:31:20 -0600 Subject: [PATCH 04/61] added missing file --- stlab/concurrency/CMakeLists.txt | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 stlab/concurrency/CMakeLists.txt diff --git a/stlab/concurrency/CMakeLists.txt b/stlab/concurrency/CMakeLists.txt new file mode 100644 index 000000000..c43a307a2 --- /dev/null +++ b/stlab/concurrency/CMakeLists.txt @@ -0,0 +1,33 @@ +target_sources( stlab INTERFACE + $ + $ ) From 001ca25e533aeabe28b1692a052e94c956812f92 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Wed, 8 Aug 2018 18:13:28 +0200 Subject: [PATCH 05/61] Draft to fix issue 154 --- stlab/concurrency/task.hpp | 58 ++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/stlab/concurrency/task.hpp b/stlab/concurrency/task.hpp index 9dde37290..b7922e80f 100644 --- a/stlab/concurrency/task.hpp +++ b/stlab/concurrency/task.hpp @@ -82,10 +82,12 @@ class task { static auto const_pointer(const void* self) noexcept -> const void* { return &static_cast(self)->_f; } - - static constexpr concept _vtable = {dtor, move_ctor, invoke, - target_type, pointer, const_pointer}; - +#if defined(__GNUC__) && __GNUC__ < 7 && !defined(__clang__) + static const concept _vtable; +#else + static constexpr concept _vtable = { dtor, move_ctor, invoke, + target_type, pointer, const_pointer }; +#endif F _f; }; @@ -110,8 +112,12 @@ class task { return static_cast(self)->_p.get(); } - static constexpr concept _vtable = {dtor, move_ctor, invoke, - target_type, pointer, const_pointer}; +#if defined(__GNUC__) && __GNUC__ < 7 && !defined(__clang__) + static const concept _vtable; +#else + static constexpr concept _vtable = { dtor, move_ctor, invoke, + target_type, pointer, const_pointer }; +#endif std::unique_ptr _p; }; @@ -124,8 +130,12 @@ class task { static auto pointer(void*) noexcept -> void* { return nullptr; } static auto const_pointer(const void*) noexcept -> const void* { return nullptr; } - static constexpr concept _vtable = {dtor, move_ctor, invoke, - target_type_, pointer, const_pointer}; +#if defined(__GNUC__) && __GNUC__ < 7 && !defined(__clang_) + static const concept _vtable; +#else + static constexpr concept _vtable = { dtor, move_ctor, invoke, + target_type_, pointer, const_pointer }; +#endif const concept* _vtable_ptr = &_vtable; @@ -206,7 +216,7 @@ class task { R operator()(Args... args) { return _vtable_ptr->invoke(&_model, std::forward(args)...); } - friend inline void swap(task& x, task& y) { return x.swap(y); } + friend inline void swap(task& x, task& y) noexcept { return x.swap(y); } friend inline bool operator==(const task& x, std::nullptr_t) { return !static_cast(x); } friend inline bool operator==(std::nullptr_t, const task& x) { return !static_cast(x); } friend inline bool operator!=(const task& x, std::nullptr_t) { return static_cast(x); } @@ -216,8 +226,18 @@ class task { #if STLAB_CPP_VERSION < 17 // In C++17 constexpr implies inline and these definitions are deprecated -template -const typename task::concept task::_vtable; + + +#if defined(__GNUC__) && __GNUC__ < 7 && !defined(__clang__) + template + const typename task::concept task::_vtable = { dtor, move_ctor, invoke, + target_type_, pointer, const_pointer }; +#else + template + const typename task::concept task::_vtable; +#endif + + #ifdef _MSC_VER @@ -231,6 +251,20 @@ const typename task::concept task::model::_vtab #else +#if defined(__GNUC__) && __GNUC__ < 7 && !defined(__clang__) + +template +template +const typename task::concept task::template model::_vtable = { dtor, move_ctor, invoke, + target_type_, pointer, const_pointer }; + +template +template +const typename task::concept task::template model::_vtable = { dtor, move_ctor, invoke, + target_type_, pointer, const_pointer }; + +#else + template template const typename task::concept task::template model::_vtable; @@ -243,6 +277,8 @@ const typename task::concept task::template model Date: Wed, 8 Aug 2018 19:41:52 +0200 Subject: [PATCH 06/61] Fixing typo --- stlab/concurrency/task.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stlab/concurrency/task.hpp b/stlab/concurrency/task.hpp index b7922e80f..6dded5278 100644 --- a/stlab/concurrency/task.hpp +++ b/stlab/concurrency/task.hpp @@ -130,7 +130,7 @@ class task { static auto pointer(void*) noexcept -> void* { return nullptr; } static auto const_pointer(const void*) noexcept -> const void* { return nullptr; } -#if defined(__GNUC__) && __GNUC__ < 7 && !defined(__clang_) +#if defined(__GNUC__) && __GNUC__ < 7 && !defined(__clang__) static const concept _vtable; #else static constexpr concept _vtable = { dtor, move_ctor, invoke, From 5be73efc2fc17e2db7715274fda1a9beceda2069 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Wed, 8 Aug 2018 12:04:46 -0600 Subject: [PATCH 07/61] reverted task --- stlab/concurrency/task.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stlab/concurrency/task.hpp b/stlab/concurrency/task.hpp index 61d0cb79b..9dde37290 100644 --- a/stlab/concurrency/task.hpp +++ b/stlab/concurrency/task.hpp @@ -83,8 +83,8 @@ class task { return &static_cast(self)->_f; } - static constexpr const concept _vtable = {dtor, move_ctor, invoke, - target_type, pointer, const_pointer}; + static constexpr concept _vtable = {dtor, move_ctor, invoke, + target_type, pointer, const_pointer}; F _f; }; @@ -110,8 +110,8 @@ class task { return static_cast(self)->_p.get(); } - static constexpr const concept _vtable = {dtor, move_ctor, invoke, - target_type, pointer, const_pointer}; + static constexpr concept _vtable = {dtor, move_ctor, invoke, + target_type, pointer, const_pointer}; std::unique_ptr _p; }; @@ -124,8 +124,8 @@ class task { static auto pointer(void*) noexcept -> void* { return nullptr; } static auto const_pointer(const void*) noexcept -> const void* { return nullptr; } - static constexpr const concept _vtable = {dtor, move_ctor, invoke, - target_type_, pointer, const_pointer}; + static constexpr concept _vtable = {dtor, move_ctor, invoke, + target_type_, pointer, const_pointer}; const concept* _vtable_ptr = &_vtable; @@ -213,7 +213,7 @@ class task { friend inline bool operator!=(std::nullptr_t, const task& x) { return static_cast(x); } }; -#if __cplusplus < 201703L +#if STLAB_CPP_VERSION < 17 // In C++17 constexpr implies inline and these definitions are deprecated template From 7944b0bef7aa36be0ac1aa2bcc2c4c4b2190f1de Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Wed, 8 Aug 2018 20:07:32 +0200 Subject: [PATCH 08/61] Correcting compiler flags --- cmake/GNU.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmake/GNU.cmake b/cmake/GNU.cmake index 1426385fc..82a6f41f9 100644 --- a/cmake/GNU.cmake +++ b/cmake/GNU.cmake @@ -2,7 +2,4 @@ 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 "" ) -# 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") +set( stlab_interface_flags "-std=gnu++14;") From 5929d95ce30af4a8b1c403c4529aad36cec16049 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Thu, 9 Aug 2018 08:43:22 +0200 Subject: [PATCH 09/61] Final changes for fix --- stlab/concurrency/task.hpp | 6 +++--- test/task_test.cpp | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stlab/concurrency/task.hpp b/stlab/concurrency/task.hpp index 6dded5278..abf09526e 100644 --- a/stlab/concurrency/task.hpp +++ b/stlab/concurrency/task.hpp @@ -216,7 +216,7 @@ class task { R operator()(Args... args) { return _vtable_ptr->invoke(&_model, std::forward(args)...); } - friend inline void swap(task& x, task& y) noexcept { return x.swap(y); } + friend inline void swap(task& x, task& y) { return x.swap(y); } friend inline bool operator==(const task& x, std::nullptr_t) { return !static_cast(x); } friend inline bool operator==(std::nullptr_t, const task& x) { return !static_cast(x); } friend inline bool operator!=(const task& x, std::nullptr_t) { return static_cast(x); } @@ -256,12 +256,12 @@ const typename task::concept task::model::_vtab template template const typename task::concept task::template model::_vtable = { dtor, move_ctor, invoke, - target_type_, pointer, const_pointer }; + target_type, pointer, const_pointer }; template template const typename task::concept task::template model::_vtable = { dtor, move_ctor, invoke, - target_type_, pointer, const_pointer }; + target_type, pointer, const_pointer }; #else diff --git a/test/task_test.cpp b/test/task_test.cpp index 1232411bf..821ff9d6a 100644 --- a/test/task_test.cpp +++ b/test/task_test.cpp @@ -194,6 +194,11 @@ BOOST_AUTO_TEST_CASE(task_type_tests) { BOOST_CHECK(!t); } + { + task t(nullptr); + BOOST_CHECK(!t); + } + { // large model task t = large_model(); From 3923f5a4745b77a0a32bad5890959644edb32879 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Fri, 10 Aug 2018 08:31:03 -0600 Subject: [PATCH 10/61] reintroduced the vendor flags and addressed compiler warnings --- CMakeLists.txt | 229 ++++++++++++++++++++--- cmake/stlab.cmake | 13 +- cmake/stlab/development.cmake | 7 + cmake/stlab/development/AppleClang.cmake | 21 +++ cmake/stlab/development/Clang.cmake | 21 +++ cmake/stlab/development/GNU.cmake | 20 ++ cmake/stlab/development/MSVC.cmake | 20 ++ stlab/concurrency/channel.hpp | 4 +- stlab/concurrency/future.hpp | 14 +- test/CMakeLists.txt | 74 ++++++-- test/channel_process_tests.cpp | 10 +- test/future_tests.cpp | 22 +-- test/future_then_tests.cpp | 4 +- test/serial_queue_test.cpp | 2 +- test/tuple_algorithm_test.cpp | 2 +- test/tuple_test.cpp | 2 +- 16 files changed, 378 insertions(+), 87 deletions(-) create mode 100644 cmake/stlab/development.cmake create mode 100644 cmake/stlab/development/AppleClang.cmake create mode 100644 cmake/stlab/development/Clang.cmake create mode 100644 cmake/stlab/development/GNU.cmake create mode 100644 cmake/stlab/development/MSVC.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b5faf281..a695c0fb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,99 +1,274 @@ cmake_minimum_required( VERSION 3.5 ) +# +# Here we check whether stlab is being configured in isolation or as a component +# of a larger proeject. To do so, we query whether the `PROJECT_NAME` CMake +# variable has been defined. In the case it has, we can conclude stlab is a +# subproject. +# +# This convention has been borrowed from the Catch C++ unit testing library. +# if( DEFINED PROJECT_NAME ) - set( root OFF ) set( subproject ON ) else() - set( root ON ) set( subproject OFF ) endif() -project( stlab VERSION 1.0 LANGUAGES C CXX ) +project( stlab VERSION 1.0 LANGUAGES CXX ) + +# +# In it's current form, stlab does not compile on the GCC C++ compiler +# from versions earlier than 7.1 as a result of a compiler defect. See +# stlab issue #154 (https://github.com/stlab/libraries/issues/154) for +# more information. +# +if( CMAKE_CXX_COMPILER STREQUAL "GNU" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.1" ) + message(FATAL_ERROR "stlab::libraries require g++ version 7.1 or later") +endif() include( CTest ) include( CMakeDependentOption ) -include( CMakePackageConfigHelpers ) +# +# The `stlab.testing` and `stlab.coverage` options only appear as +# cmake-gui and ccmake options iff stlab is the highest level project. +# In the case that stlab is a subproject, these options are hidden from +# the user interface and set to `OFF` +# cmake_dependent_option( stlab.testing "Compile the stlab tests and integrate with ctest" - ON "root;BUILD_TESTING" OFF ) + ${BUILD_TESTING} "NOT subproject" OFF ) cmake_dependent_option( stlab.coverage "Enable binary instrumentation to collect test coverage information in the DEBUG configuration" - OFF "root" OFF ) + OFF "NOT subproject" OFF ) +option( stlab.boost_variant "Prefer Boost::variant to std::variant" OFF ) +option( stlab.boost_optional "Prefer Boost::optional to std::optional" OFF ) option( stlab.coroutines "Integrate the C++17 coroutines TS in stlab" OFF ) -mark_as_advanced( stlab.coroutines ) +mark_as_advanced( stlab.coroutines stlab.boost_variant stlab.boost_optional ) +# +# stlab has no compiled components. As such, we declare it as an `INTERFACE` +# library, which denotes a collection of target propeties to be applied +# transitively to linking targets. In our case, this ammounts to an include +# directory, compile flags, linking flags, and links to system libraries. +# add_library( stlab INTERFACE ) add_library( stlab::stlab ALIAS stlab ) +# +# stlab requires C++ 14 support, at a minimum. Setting the `cxx_std_14` compile +# features ensures that the corresponding C++ standard flag is populated in +# targets linking to stlab. +# target_compile_features( stlab INTERFACE cxx_std_14 ) + +# +# The include directory for stlab can be expected to vary between build +# and installaion. Here we use a CMake generator expression to dispatch +# on how the configuration under which this library is being consumed. +# target_include_directories( stlab INTERFACE $ $ ) +# +# As of CMake version 3.1, the FindThreads CMake module supplies an imported +# target called `Thread::Thread` which transitively supplies inlude directories, +# compiler flags, and linker flags to CMake targets linking to it. +# set( CMAKE_THREAD_PREFER_PTHREAD TRUE ) find_package( Threads REQUIRED ) target_link_libraries( stlab INTERFACE Threads::Threads ) -add_subdirectory( stlab/concurrency ) +# +# Several definitions are specified for the microsoft compiler. These have +# the following effects. +# +# + NOMINMAX +# disable the `min` and `max` macros defined in the windows.h header +# +# In addition, If coroutines are not explicitly enabled, a preprocessor +# definition is specified to disable their use in the source code. +# +target_compile_definitions( stlab INTERFACE + $<$:NOMINMAX> + $<$>:STLAB_DISABLE_FUTURE_COROUTINES>) -if ( stlab.testing ) - list( APPEND CMAKE_MODULE_DIR "${stlab_SOURCE_DIR}/cmake" ) -# include( development ) +add_subdirectory( stlab/concurrency ) +if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) include( conanbuildinfo.cmake ) + + # + # using the `TARGETS` keyword in the `conan_basic_setup` invocation + # will populate targets for each conan package specified in the + # conanfile.txt + # conan_basic_setup( TARGETS ) + + # + # We provide aliases to the conan target to mimic the native findBoost + # functionality + # + add_library( Boost::boost ALIAS CONAN_PKG::Boost ) add_library( Boost::unit_test_framework ALIAS CONAN_PKG::Boost ) else() - find_package( Boost 1.60.0 REQUIRED COMPONENTS unit_test_framework ) + + # + # Request compiled unit testing component only if testing is `ON` + # + if( stlab.testing ) + find_package( Boost 1.60.0 REQUIRED COMPONENTS unit_test_framework ) + else() + find_package( Boost 1.60.0 REQUIRED ) + endif() endif() + string( APPEND either_generator + "$," + "$>" ) + + # + # Link to the Boost::boost target is either `stlab.boost_optional` + # or `stlab.boost_variant` are set `ON` which provides the include + # directory for the boost header. + # + target_link_libraries( stlab INTERFACE $<${either_generator}:Boost::boost> ) + + # + # Conditionally specify the corresponding compiler definitions for + # each boost algebraic data type library. In the case that either + # is specified, a preprocessor definition is used to specify that + # `auto_ptr` should not be used in the boost headers. + # + target_compile_definitions( stlab INTERFACE + $<$:STLAB_FORCE_BOOST_OPTIONAL> + $<$:STLAB_FORCE_BOOST_VARIANT> + $<${either_generator}:BOOST_NO_AUTO_PTR=1> ) + unset( either_generator ) +endif() + +if ( stlab.testing ) + list( APPEND CMAKE_MODULE_PATH "${stlab_SOURCE_DIR}/cmake" ) + include( stlab/development ) + + # + # Establish a convenience target to encapsulate the properties # common to the + # stlab tests and establish an alias for uniformity. + # add_library( testing INTERFACE ) + add_library( stlab::testing ALIAS testing ) + + # + # CMake targets linking to the stlab::testing target will (transitively) + # link to the Boost::unit_test_framework and to stlab::stlab target. + # target_link_libraries( testing INTERFACE Boost::unit_test_framework -# stlab::development + stlab::development stlab::stlab ) + # + # Linking to the Boost unit test framework requires an additional + # preprocessor definition when the unit test compiled resources are + # provided by a shared library rather than a static library. + # target_compile_definitions( testing INTERFACE - $<$>:BOOST_TEST_DYN_LINK> ) - - set_target_properties( testing PROPERTIES - INTERFACE_CXX_EXTENSIONS OFF ) - - add_library( stlab::testing ALIAS testing ) + $<$>:BOOST_TEST_DYN_LINK>) add_subdirectory( test ) endif() +include( CMakePackageConfigHelpers ) # provides `write_basic_package_version_file` + +# +# We generate a CMake version file for later installation to be consumed by +# CMake's `find_package` intrinsic. Here we specify a semantic version +# convention, i.e., backwards compatability can be assumed within a Major +# version. +# write_basic_package_version_file( "${stlab_BINARY_DIR}/stlabConfigVersion.cmake" VERSION ${stlab_VERSION} COMPATIBILITY SameMajorVersion ) -install( TARGETS stlab - EXPORT stlabTargets - BUNDLE DESTINATION bin COMPONENT Runtime - RUNTIME DESTINATION bin COMPONENT Runtime - LIBRARY DESTINATION lib COMPONENT Runtime - ARCHIVE DESTINATION lib COMPONENT Development - PUBLIC_HEADER DESTINATION include COMPONENT Development ) +# +# As a header-only library, there are no target components to be installed +# directly (the PUBLIC_HEADER property is not white listed for INTERFACE +# targets for some reason). +# +# However, it is worthwhile export our target description in order to later +# generate a CMake configuration file for consumption by CMake's `find_package` +# intrinsic +# +install( TARGETS stlab EXPORT stlabTargets ) +# +# Non-testing header files (preserving relative paths) are installed to the +# `include` subdirectory of the `$INSTALL_DIR/${CMAKE_INSTALL_PREFIX}` +# directory. Source file permissions preserved. +# install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/stlab DESTINATION include USE_SOURCE_PERMISSIONS - FILES_MATCHING PATTERN "*.hpp" ) + FILES_MATCHING + PATTERN "*.hpp" + PATTERN "*test*" EXCLUDE ) +# +# A CMake configuration file is generated describing the stlab exported targets. +# This file is included by (and installed with) the cmake/CMakeConfig.cmake file +# under version control. +# install( EXPORT stlabTargets FILE stlabTargets.cmake NAMESPACE stlab:: DESTINATION share/cmake/stlab ) +# +# Install the CMake configuration files to the `share/cmake/stlab` subdirectory +# of `$INSTALL_DIR/${CMAKE_INSTALL_PREFIX}`. This path will be searched by +# default by the `find_package` intrinsic, provided +# `$INSTALL_DIR/${CMAKE_INSTALL_PREFIX}` is an element of the +# `CMAKE_PREFIX_PATH` environment variable. +# install( FILES "${stlab_SOURCE_DIR}/cmake/stlabConfig.cmake" "${stlab_BINARY_DIR}/stlabConfigVersion.cmake" DESTINATION share/cmake/stlab ) +# +# Rudimentary CPack support. +# +# CPack provides a mechanism to generate installation packaging for a project, +# e.g., self-extracting shell scripts, compressed tarballs, Debian Package files, +# RPM Package Manager files, Windows NSIS installation wizards, +# Apple Disk Images (.dmg), etc. +# +# Any system libraries required (runtimes, threading, etc) should be bundled +# with the project for this type of installation. The +# `InstallRequiredSystemLibraries` CMake module attempts to provide this +# functionality in an automated way. Additional libraries may be specified as +# +# ```cmake +# list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ) +# ``` +# +# A packaged installation can be generated by calling +# +# ```sh +# cpack -G --config CPackConfig.cmake +# ``` +# +# See `cpack --help` or the CPack documentation for more information. +# +include( InstallRequiredSystemLibraries ) +set( CPACK_PACKAGE_VENDOR "Adobe Software Technology Lab" ) +set( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" ) +set( CMAKE_PROJECT_HOMEPAGE_URL "http://stlab.cc/libraries/" ) +include( CPack ) diff --git a/cmake/stlab.cmake b/cmake/stlab.cmake index 31a65f3bf..1b8cc32bb 100644 --- a/cmake/stlab.cmake +++ b/cmake/stlab.cmake @@ -1,13 +1,2 @@ -if(CMAKE_VERSION VERSION_LESS "3.10") - if(DEFINED stlab.cmake) - return() - endif() +include(stlab/development) - set(stlab.cmake "" CACHE INTERNAL "") -else() - include_gaurd(GLOBAL) -endif() - -include(stlab/warnings) -include(stlab/coverage) -include(stlab/coroutines) diff --git a/cmake/stlab/development.cmake b/cmake/stlab/development.cmake new file mode 100644 index 000000000..7ec56c0ec --- /dev/null +++ b/cmake/stlab/development.cmake @@ -0,0 +1,7 @@ +add_library( development INTERFACE ) +add_library( stlab::development ALIAS development ) + +include(stlab/development/GNU) +include(stlab/development/Clang) +include(stlab/development/AppleClang) +include(stlab/development/MSVC) diff --git a/cmake/stlab/development/AppleClang.cmake b/cmake/stlab/development/AppleClang.cmake new file mode 100644 index 000000000..221076617 --- /dev/null +++ b/cmake/stlab/development/AppleClang.cmake @@ -0,0 +1,21 @@ +set( stlab_AppleClang_base_flags -Wall -Wextra -Wpedantic -Werror -ftemplate-backtrace-limit=0 ) +set( stlab_AppleClang_debug_flags -gdwarf-3 ) +set( stlab_AppleClang_coverage_flags --coverage ) +set( stlab_AppleClang_release_flags ) + +string(CONCAT generator + "${stlab_AppleClang_base_flags}" + "$<$," + "$>:${stlab_AppleClang_debug_flags}>" + "$<$," + "$," + "$>:${stlab_AppleClang_release_flags}>" + "$<$," + "$>:${stlab_AppleClang_debug_flags}>") + +target_compile_options(development INTERFACE + $<$:${generator}>) + +target_link_libraries(development INTERFACE + $<$:${generator}>) + diff --git a/cmake/stlab/development/Clang.cmake b/cmake/stlab/development/Clang.cmake new file mode 100644 index 000000000..6a691039e --- /dev/null +++ b/cmake/stlab/development/Clang.cmake @@ -0,0 +1,21 @@ +set( stlab_Clang_base_flags -Wall -Wextra -Wpedantic -Werror -ftemplate-backtrace-limit=0 ) +set( stlab_Clang_debug_flags -gdwarf-3 ) +set( stlab_Clang_coverage_flags --coverage ) +set( stlab_Clang_release_flags ) + +string(CONCAT generator + "${stlab_Clang_base_flags}" + "$<$," + "$>:${stlab_Clang_debug_flags}>" + "$<$," + "$," + "$>:${stlab_Clang_release_flags}>" + "$<$," + "$>:${stlab_Clang_debug_flags}>") + +target_compile_options(development INTERFACE + $<$:${generator}>) + +target_link_libraries(development INTERFACE + $<$:${generator}>) + diff --git a/cmake/stlab/development/GNU.cmake b/cmake/stlab/development/GNU.cmake new file mode 100644 index 000000000..0aad116f4 --- /dev/null +++ b/cmake/stlab/development/GNU.cmake @@ -0,0 +1,20 @@ +set( stlab_GNU_base_flags -Wall -Wextra -Wpedantic -Werror -ftemplate-backtrace-limit=0 ) +set( stlab_GNU_debug_flags -gdwarf-3 ) +set( stlab_GNU_coverage_flags --coverage ) +set( stlab_GNU_release_flags ) + +string(CONCAT generator + "${stlab_GNU_base_flags}" + "$<$," + "$>:${stlab_GNU_debug_flags}>" + "$<$," + "$," + "$>:${stlab_GNU_release_flags}>" + "$<$," + "$>:${stlab_GNU_debug_flags}>") + +target_compile_options(development INTERFACE + $<$:${generator}>) + +target_link_libraries(development INTERFACE + $<$:${generator}>) diff --git a/cmake/stlab/development/MSVC.cmake b/cmake/stlab/development/MSVC.cmake new file mode 100644 index 000000000..6a10330a6 --- /dev/null +++ b/cmake/stlab/development/MSVC.cmake @@ -0,0 +1,20 @@ +set( stlab_MSVC_base_flags /W4 /Wx ) +set( stlab_MSVC_debug_flags ) +set( stlab_MSVC_coverage_flags ) +set( stlab_MSVC_release_flags ) + +string(CONCAT generator + "${stlab_MSVC_base_flags}" + "$<$," + "$>:${stlab_MSVC_debug_flags}>" + "$<$," + "$," + "$>:${stlab_MSVC_release_flags}>" + "$<$," + "$>:${stlab_MSVC_debug_flags}>") + +target_compile_options(development INTERFACE + $<$:${generator}>) + +target_link_libraries(development INTERFACE + $<$:${generator}>) diff --git a/stlab/concurrency/channel.hpp b/stlab/concurrency/channel.hpp index 986e759e5..400dc1571 100644 --- a/stlab/concurrency/channel.hpp +++ b/stlab/concurrency/channel.hpp @@ -312,7 +312,7 @@ auto get_process_state(const stlab::optional& x) } template -auto get_process_state(const stlab::optional& x) +auto get_process_state(const stlab::optional&) -> std::enable_if_t, process_state_scheduled> { return await_forever; } @@ -332,7 +332,7 @@ auto set_process_error(P& process, std::exception_ptr&& error) } template -auto set_process_error(P&, std::exception_ptr&& error) +auto set_process_error(P&, std::exception_ptr&&) -> std::enable_if_t, void> {} /**************************************************************************************************/ diff --git a/stlab/concurrency/future.hpp b/stlab/concurrency/future.hpp index 9829d7719..e33815ded 100644 --- a/stlab/concurrency/future.hpp +++ b/stlab/concurrency/future.hpp @@ -782,7 +782,7 @@ class future> { } void detach() const { - then([_hold = _p](auto f) {}, [](const auto&) {}); + then([_hold = _p](auto) {}, [](const auto&) {}); } void reset() { _p.reset(); } @@ -873,7 +873,7 @@ class future { } void detach() const { - then([_hold = _p](auto f) {}, []() {}); + then([_hold = _p](auto) {}, []() {}); } void reset() { _p.reset(); } @@ -946,7 +946,7 @@ class future> { } void detach() const { - _p->then_r(unique_usage(_p), [_hold = _p](auto f) {}, [](auto&&) {}); + _p->then_r(unique_usage(_p), [_hold = _p](auto) {}, [](auto&&) {}); } void reset() { _p.reset(); } @@ -995,7 +995,7 @@ struct assign_ready_future { template <> struct assign_ready_future> { template - static void assign(T& x, future& f) { + static void assign(T& x, future&) { x = std::move(typename T::value_type()); // to set the optional } }; @@ -1081,7 +1081,7 @@ struct when_any_shared { } template - void done(FF&& f) { + void done(FF&&) { auto before = _value_received.test_and_set(); if (before == false) { _index = index; @@ -1690,7 +1690,7 @@ auto shared_base::recover(E&& executor, F&& f) template auto shared_base>::reduce(future>&& r) -> future { - return std::move(r).then([](auto f) {}); + return std::move(r).then([](auto) {}); } template @@ -1710,7 +1710,7 @@ auto shared_base>::reduce(future>&& r) -> /**************************************************************************************************/ inline auto shared_base::reduce(future>&& r) -> future { - return std::move(r).then([](auto f) {}); + return std::move(r).then([](auto) {}); } template diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 750e69d8b..61e0464b4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable( stlab.test.channel.test +add_executable( stlab.test.channel channel_functor_tests.cpp channel_merge_round_robin_tests.cpp channel_merge_unordered_tests.cpp @@ -10,12 +10,12 @@ add_executable( stlab.test.channel.test main.cpp channel_test_helper.hpp ) -target_link_libraries( stlab.test.channel.test PUBLIC stlab::testing ) -add_test( NAME stlab.test.channel COMMAND stlab.test.channel.test ) +target_link_libraries( stlab.test.channel PUBLIC stlab::testing ) +add_test( NAME stlab.test.channel COMMAND stlab.test.channel ) ################################################################################ -add_executable( stlab.test.future.test +add_executable( stlab.test.future future_coroutine_tests.cpp future_recover_tests.cpp future_test_helper.cpp @@ -29,41 +29,79 @@ add_executable( stlab.test.future.test main.cpp future_test_helper.hpp ) -target_link_libraries( stlab.test.future.test PUBLIC stlab::testing ) -add_test( NAME stlab.test.future COMMAND stlab.test.future.test ) +target_link_libraries( stlab.test.future PUBLIC stlab::testing ) +add_test( NAME stlab.test.future COMMAND stlab.test.future ) ################################################################################ -add_executable( stlab.test.serial_queue.test +add_executable( stlab.test.serial_queue serial_queue_test.cpp ) -target_link_libraries( stlab.test.serial_queue.test PUBLIC stlab::testing ) -add_test( NAME stlab.test.serial_queue COMMAND stlab.test.serial_queue.test ) +target_link_libraries( stlab.test.serial_queue PUBLIC stlab::testing ) +add_test( NAME stlab.test.serial_queue COMMAND stlab.test.serial_queue ) ################################################################################ -add_executable( stlab.test.cow.test +add_executable( stlab.test.cow cow_test.cpp main.cpp ) -target_link_libraries( stlab.test.cow.test PUBLIC stlab::testing ) -add_test( NAME stlab.test.cow COMMAND stlab.test.cow.test ) +target_link_libraries( stlab.test.cow PUBLIC stlab::testing ) +add_test( NAME stlab.test.cow COMMAND stlab.test.cow ) ################################################################################ -add_executable( stlab.test.task.test +add_executable( stlab.test.task task_test.cpp main.cpp ) -target_link_libraries( stlab.test.task.test PUBLIC stlab::testing ) -add_test( NAME stlab.test.task COMMAND stlab.test.task.test ) +target_link_libraries( stlab.test.task PUBLIC stlab::testing ) +add_test( NAME stlab.test.task COMMAND stlab.test.task ) ################################################################################ -add_executable( stlab.test.tuple.test +add_executable( stlab.test.tuple tuple_test.cpp main.cpp ) -target_link_libraries( stlab.test.tuple.test PUBLIC stlab::testing ) -add_test( NAME stlab.test.tuple COMMAND stlab.test.tuple.test ) +target_link_libraries( stlab.test.tuple PUBLIC stlab::testing ) +add_test( NAME stlab.test.tuple COMMAND stlab.test.tuple ) +################################################################################ + +# +# tests are compiled without compiler extensions to ensure the stlab headers +# are not dependent upon any such extension. +# +set_target_properties( + stlab.test.channel + stlab.test.future + stlab.test.serial_queue + stlab.test.cow + stlab.test.task + stlab.test.tuple + PROPERTIES CXX_EXTENSIONS OFF ) + +# +# Many of the stlab tests are executed using the system executor which defaults +# to a number of threads equal to the system parallelism. +# +# Here we (attempt to) query the system processor count and store the value in +# the `nProcessors` variable, where a non-zeros value indicates success. +# +# Provided the query was successful, we inform ctest of the test parallism. +# + +include(ProcessorCount) +ProcessorCount(nProcessors) + +if(nProcessors) + set_tests_properties( + stlab.test.channel + stlab.test.future + stlab.test.serial_queue + stlab.test.cow + stlab.test.task + stlab.test.tuple + PROPERTIES PROCESSORS ${nProcessors}) +endif() diff --git a/test/channel_process_tests.cpp b/test/channel_process_tests.cpp index 4805618c2..4002100d2 100644 --- a/test/channel_process_tests.cpp +++ b/test/channel_process_tests.cpp @@ -305,9 +305,9 @@ struct process_with_set_error { std::atomic_bool& _check; - void await(int n) { throw std::runtime_error{""}; } + void await(int) { throw std::runtime_error{""}; } - void set_error(std::exception_ptr error) { _check = true; } + void set_error(std::exception_ptr) { _check = true; } int yield() { return 42; } @@ -329,7 +329,7 @@ BOOST_AUTO_TEST_CASE(int_channel_process_set_error_is_called_on_upstream_error) throw std::runtime_error{""}; return v; } | - process_with_set_error{check} | [](int x) {}; + process_with_set_error{check} | [](int) {}; receive.set_ready(); send(42); @@ -347,7 +347,7 @@ struct process_with_close { std::atomic_bool& _check; - void await(int n) { throw std::runtime_error{""}; } + void await(int) { throw std::runtime_error{""}; } void close() { _check = true; } @@ -371,7 +371,7 @@ BOOST_AUTO_TEST_CASE(int_channel_process_close_is_called_on_upstream_error) { throw std::runtime_error{""}; return v; } | - process_with_close{check} | [](int x) {}; + process_with_close{check} | [](int) {}; receive.set_ready(); send(42); diff --git a/test/future_tests.cpp b/test/future_tests.cpp index f3732652c..c678ab170 100644 --- a/test/future_tests.cpp +++ b/test/future_tests.cpp @@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { BOOST_TEST_MESSAGE("running async lambda argument of type rvalue -> value"); annotate_counters counters; - async(immediate_executor, [](annotate x) {}, annotate(counters)); + async(immediate_executor, [](annotate) {}, annotate(counters)); BOOST_REQUIRE(counters.remaining() == 0); BOOST_REQUIRE(counters._copy_ctor == 0); } @@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { annotate_counters counters; annotate x(counters); - async(immediate_executor, [](annotate x) {}, x); + async(immediate_executor, [](annotate) {}, x); BOOST_REQUIRE(counters.remaining() == 1); BOOST_REQUIRE(counters._copy_ctor == 1); } @@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { annotate_counters counters; annotate x(counters); - async(immediate_executor, [](annotate x) {}, std::ref(x)); + async(immediate_executor, [](annotate) {}, std::ref(x)); BOOST_REQUIRE(counters.remaining() == 1); BOOST_REQUIRE(counters._copy_ctor == 1); } @@ -76,7 +76,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { annotate_counters counters; annotate x(counters); - async(immediate_executor, [](annotate x) {}, std::cref(x)); + async(immediate_executor, [](annotate) {}, std::cref(x)); BOOST_REQUIRE(counters.remaining() == 1); BOOST_REQUIRE(counters._copy_ctor == 1); } @@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { BOOST_TEST_MESSAGE("running async lambda argument of type rvalue -> &"); annotate_counters counters; - async(immediate_executor, [](annotate& x){ }, annotate(counters)); + async(immediate_executor, [](annotate&){ }, annotate(counters)); BOOST_REQUIRE(counters.remaining() == 0); BOOST_REQUIRE(counters._copy_ctor == 0); } @@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { annotate_counters counters; annotate x(counters); - async(immediate_executor, [](annotate& x){ }, x); + async(immediate_executor, [](annotate&){ }, x); BOOST_REQUIRE(counters.remaining() == 1); BOOST_REQUIRE(counters._copy_ctor == 1); } @@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { annotate_counters counters; annotate x(counters); - async(immediate_executor, [](annotate& x){ }, std::cref(x)); + async(immediate_executor, [](annotate&){ }, std::cref(x)); BOOST_REQUIRE(counters.remaining() == 1); BOOST_REQUIRE(counters._copy_ctor == 1); } @@ -191,7 +191,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { annotate_counters counters; annotate x(counters); - async(immediate_executor, [](annotate&& x){ }, std::ref(x)); + async(immediate_executor, [](annotate&&){ }, std::ref(x)); BOOST_REQUIRE(counters.remaining() == 1); BOOST_REQUIRE(counters._copy_ctor == 0); } @@ -201,7 +201,7 @@ BOOST_AUTO_TEST_CASE(async_lambda_arguments) { annotate_counters counters; annotate x(counters); - async(immediate_executor, [](annotate&& x){ }, std::cref(x)); + async(immediate_executor, [](annotate&&){ }, std::cref(x)); BOOST_REQUIRE(counters.remaining() == 1); BOOST_REQUIRE(counters._copy_ctor == 0); } @@ -538,7 +538,7 @@ BOOST_AUTO_TEST_CASE(future_int_detach_without_execution) { bool check = true; { auto p = package(stlab::immediate_executor, [] { return 42; }); - p.second.then([a = stlab::annotate(counter), &_check = check](int x) { _check = false; }).detach(); + p.second.then([a = stlab::annotate(counter), &_check = check](int) { _check = false; }).detach(); } std::cout << counter; @@ -552,7 +552,7 @@ BOOST_AUTO_TEST_CASE(future_move_only_detach_without_execution) { bool check = true; { auto p = package(stlab::immediate_executor, [] { return move_only{42}; }); - auto r = std::move(p.second).then([a = stlab::annotate(counter), &_check = check](auto&& x) { _check = false; }); + auto r = std::move(p.second).then([a = stlab::annotate(counter), &_check = check](auto&&) { _check = false; }); r.detach(); } std::cout << counter; diff --git a/test/future_then_tests.cpp b/test/future_then_tests.cpp index 13a2584c5..eb9d1404c 100644 --- a/test/future_then_tests.cpp +++ b/test/future_then_tests.cpp @@ -381,7 +381,7 @@ BOOST_AUTO_TEST_CASE(future_continuation_moving_move_only_capture_to_result) { stlab::v1::move_only m{42}; sut = async(custom_scheduler<0>(), [] { return stlab::v1::move_only{10}; }) - .then([& _m = m](auto x) mutable { return std::move(_m); }); + .then([& _m = m](auto) mutable { return std::move(_m); }); check_valid_future(sut); auto result = wait_until_future_r_completed(sut); @@ -396,7 +396,7 @@ BOOST_AUTO_TEST_CASE(future_continuation_async_mutable_move_move_only_capture_to stlab::v1::move_only m{42}; sut = async(custom_scheduler<0>(), []() mutable { return stlab::v1::move_only{10}; }) - .then([& _m = m](auto x) mutable { return std::move(_m); }); + .then([& _m = m](auto) mutable { return std::move(_m); }); check_valid_future(sut); auto result = wait_until_future_r_completed(sut); diff --git a/test/serial_queue_test.cpp b/test/serial_queue_test.cpp index 74b834522..4ea90deb2 100644 --- a/test/serial_queue_test.cpp +++ b/test/serial_queue_test.cpp @@ -169,7 +169,7 @@ void test1(stlab::schedule_mode mode) { /**************************************************************************************************/ -int main(int argc, const char* argv[]) { +int main(int, const char*[]) { test0(stlab::schedule_mode::single); std::cout << "-=-=-=-=-\n"; diff --git a/test/tuple_algorithm_test.cpp b/test/tuple_algorithm_test.cpp index db9eb019f..62cf5e092 100644 --- a/test/tuple_algorithm_test.cpp +++ b/test/tuple_algorithm_test.cpp @@ -16,7 +16,7 @@ BOOST_AUTO_TEST_SUITE(tuple_find_test) BOOST_AUTO_TEST_CASE(empty_tuple) { std::tuple<> t; - BOOST_REQUIRE_EQUAL(std::size_t(1), stlab::tuple_find(t, [](const auto& t) { return false; })); + BOOST_REQUIRE_EQUAL(std::size_t(1), stlab::tuple_find(t, [](const auto&) { return false; })); } BOOST_AUTO_TEST_CASE(one_element_tuple_that_fails) { diff --git a/test/tuple_test.cpp b/test/tuple_test.cpp index 685defdf8..05da261fd 100644 --- a/test/tuple_test.cpp +++ b/test/tuple_test.cpp @@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(add_placeholder_test) { /**************************************************************************************************/ template -void when_all_typecheck(F f, future... args) { +void when_all_typecheck(F, future...) { using pt_t = placeholder_tuple; using opt_t = optional_placeholder_tuple; using vt_t = voidless_tuple; From b808869c76913bded979449474aded2634ed0d94 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Fri, 10 Aug 2018 08:40:58 -0600 Subject: [PATCH 11/61] updated travis CI config and script --- .travis.yml | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a75f3244..652f44f5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,14 +13,13 @@ 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 packages: - g++-5 - clang-3.8 branches: except: /pr\/.*/ - + matrix: include: # @@ -39,8 +38,8 @@ matrix: env: build_type=debug - options="-D stlab_testing=ON" - + options="" + - os: osx compiler: clang osx_image: xcode9 @@ -54,7 +53,7 @@ matrix: env: build_type=release - options="-D stlab_testing=ON" + options="" # # Linux Clang, Debug & Release @@ -63,13 +62,13 @@ matrix: compiler: clang env: build_type=debug - options="-D stlab_testing=ON" - + options="" + - os: linux compiler: clang env: build_type=release - options="-D stlab_testing=ON" + options="" # # Linux GCC, Debug & Release @@ -78,13 +77,13 @@ matrix: compiler: gcc env: build_type=debug - options="-D stlab_testing=ON" + options="" - os: linux compiler: gcc env: build_type=release - options="-D stlab_testing=ON" + options="" # # Address sanitizer @@ -93,8 +92,8 @@ matrix: compiler: clang env: build_type=debug - flags="-fsanitize=address;-fno-omit-frame-pointer;" - options="-D stlab_testing=ON" + flags="-fsanitize=address;-fno-omit-frame-pointer;-fno-sanitize-recover=all" + options="" # # Undefined behavior sanitizer @@ -103,8 +102,8 @@ matrix: compiler: clang env: build_type=debug - flags="-fsanitize=undefined;-fno-omit-frame-pointer;" - options="-D stlab_testing=ON" + flags="-fsanitize=undefined;-fno-omit-frame-pointer;;-fno-sanitize-recover=all" + options="" # # Thread sanitizer @@ -114,8 +113,8 @@ matrix: env: build_type=debug TSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions" - flags="-fsanitize=thread;-fno-omit-frame-pointer;" - options="-D stlab_testing=ON" + flags="-fsanitize=thread;-fno-omit-frame-pointer;;-fno-sanitize-recover=all" + options="" # # Coverage @@ -125,7 +124,7 @@ matrix: env: build_type=debug coverage=TRUE - options="-D stlab_testing=ON -D coverage=ON" + options="-D stlab.coverage=ON" packages: - lcov after_success: @@ -139,7 +138,7 @@ matrix: compiler: clang env: build_type=debug - options="-D stlab_testing=ON" + options="" before_install: - pip install --user conan - ./enhance_conan.sh @@ -150,7 +149,6 @@ matrix: - 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 packages: - g++-5 - clang-3.8 @@ -166,9 +164,9 @@ matrix: before_install: - pip install --user conan - - ./enhance_conan.sh - - + - ./enhance_conan.sh + + install: ############################################################################ # All the dependencies are installed in ${HOME}/deps/ @@ -188,17 +186,17 @@ install: 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: - felix@petriconi.net From 73853be72c8779ce4e6716da168f0e620364b927 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Fri, 10 Aug 2018 08:41:55 -0600 Subject: [PATCH 12/61] updated travis CI script --- .travis/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis/build.sh b/.travis/build.sh index b983accd8..e4e16db16 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -28,7 +28,6 @@ if [ "$NPROC" == "" ] ; then fi if [ ! -z "$flags" ]; then extra_flags="-D stlab_appended_flags=$flags"; fi - cmake -D CMAKE_BUILD_TYPE=$build_type $options $extra_flags .. if [ $? -ne 0 ]; then exit 1; fi From a57ccb433826c2fbe5f57873a0cc1ab759b6359d Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Fri, 10 Aug 2018 17:57:17 -0600 Subject: [PATCH 13/61] Added coroutine support and addressed compiler warnings --- CMakeLists.txt | 19 +++++------ cmake/AppleClang.cmake | 5 --- cmake/Clang.cmake | 7 ---- cmake/GNU.cmake | 8 ----- cmake/MSVC.cmake | 6 ---- cmake/stlab.cmake | 2 +- cmake/stlab/coroutines/AppleClang.cmake | 21 ++++++++++++ cmake/stlab/coroutines/Clang.cmake | 40 ++++++++++++++++++++++ cmake/stlab/coroutines/GNU.cmake | 20 +++++++++++ cmake/stlab/coroutines/MSVC.cmake | 43 ++++++++++++++++++++++++ cmake/stlab/development.cmake | 8 ++--- stlab/concurrency/serial_queue.hpp | 2 ++ test/channel_functor_tests.cpp | 3 ++ test/channel_merge_round_robin_tests.cpp | 2 ++ test/channel_merge_unordered_tests.cpp | 3 ++ test/channel_merge_zip_with_tests.cpp | 3 ++ test/channel_process_tests.cpp | 2 ++ test/channel_test_helper.hpp | 3 ++ test/channel_tests.cpp | 5 ++- test/tuple_test.cpp | 3 ++ 20 files changed, 163 insertions(+), 42 deletions(-) delete mode 100644 cmake/AppleClang.cmake delete mode 100644 cmake/Clang.cmake delete mode 100644 cmake/GNU.cmake delete mode 100644 cmake/MSVC.cmake create mode 100644 cmake/stlab/coroutines/AppleClang.cmake create mode 100644 cmake/stlab/coroutines/Clang.cmake create mode 100644 cmake/stlab/coroutines/GNU.cmake create mode 100644 cmake/stlab/coroutines/MSVC.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a695c0fb2..624062df6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,8 @@ cmake_dependent_option( stlab.coverage option( stlab.boost_variant "Prefer Boost::variant to std::variant" OFF ) option( stlab.boost_optional "Prefer Boost::optional to std::optional" OFF ) -option( stlab.coroutines "Integrate the C++17 coroutines TS in stlab" OFF ) +option( stlab.coroutines "Leverage the coroutine TS in stlab" OFF ) + mark_as_advanced( stlab.coroutines stlab.boost_variant stlab.boost_optional ) # @@ -90,12 +91,7 @@ target_link_libraries( stlab INTERFACE Threads::Threads ) # + NOMINMAX # disable the `min` and `max` macros defined in the windows.h header # -# In addition, If coroutines are not explicitly enabled, a preprocessor -# definition is specified to disable their use in the source code. -# -target_compile_definitions( stlab INTERFACE - $<$:NOMINMAX> - $<$>:STLAB_DISABLE_FUTURE_COROUTINES>) +target_compile_definitions( stlab INTERFACE $<$:NOMINMAX> ) add_subdirectory( stlab/concurrency ) @@ -153,12 +149,15 @@ if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) unset( either_generator ) endif() +list( APPEND CMAKE_MODULE_PATH "${stlab_SOURCE_DIR}/cmake" ) +include( stlab/coroutines ) +target_link_libraries( stlab INTERFACE stlab::coroutines ) + if ( stlab.testing ) - list( APPEND CMAKE_MODULE_PATH "${stlab_SOURCE_DIR}/cmake" ) include( stlab/development ) # - # Establish a convenience target to encapsulate the properties # common to the + # Establish a convenience target to encapsulate the properties common to the # stlab tests and establish an alias for uniformity. # add_library( testing INTERFACE ) @@ -206,7 +205,7 @@ write_basic_package_version_file( # generate a CMake configuration file for consumption by CMake's `find_package` # intrinsic # -install( TARGETS stlab EXPORT stlabTargets ) +install( TARGETS stlab coroutines EXPORT stlabTargets ) # # Non-testing header files (preserving relative paths) are installed to the diff --git a/cmake/AppleClang.cmake b/cmake/AppleClang.cmake deleted file mode 100644 index 6c472b1ee..000000000 --- a/cmake/AppleClang.cmake +++ /dev/null @@ -1,5 +0,0 @@ -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;") diff --git a/cmake/Clang.cmake b/cmake/Clang.cmake deleted file mode 100644 index a4637ae20..000000000 --- a/cmake/Clang.cmake +++ /dev/null @@ -1,7 +0,0 @@ -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++latest;-DBOOST_NO_AUTO_PTR=1;") -set( stlab_coroutine_flags "-fcoroutines-ts;") - diff --git a/cmake/GNU.cmake b/cmake/GNU.cmake deleted file mode 100644 index 1426385fc..000000000 --- a/cmake/GNU.cmake +++ /dev/null @@ -1,8 +0,0 @@ -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 "" ) -# 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") diff --git a/cmake/MSVC.cmake b/cmake/MSVC.cmake deleted file mode 100644 index b1b6828ab..000000000 --- a/cmake/MSVC.cmake +++ /dev/null @@ -1,6 +0,0 @@ -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;/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;") diff --git a/cmake/stlab.cmake b/cmake/stlab.cmake index 1b8cc32bb..f8c440c23 100644 --- a/cmake/stlab.cmake +++ b/cmake/stlab.cmake @@ -1,2 +1,2 @@ include(stlab/development) - +include(stlab/coroutines) diff --git a/cmake/stlab/coroutines/AppleClang.cmake b/cmake/stlab/coroutines/AppleClang.cmake new file mode 100644 index 000000000..cb6579c7b --- /dev/null +++ b/cmake/stlab/coroutines/AppleClang.cmake @@ -0,0 +1,21 @@ +# +# If the current compiler doesn't support coroutines and coroutine support +# has been requested, issue a warning indicating the tests will exercise the +# coroutine integration in the stlab library. +# +# As of writing, no version of the Apple Clang (as opposed to the LLVM Clang) +# compiler supports the coroutines TS. +# +if( CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND stlab.coroutines ) + message( WARNING "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} does not support coroutines." ) + message( STATUS "Coroutines will not be used in testing" ) +endif() + +# +# If using AppleClang, set a preprocessor definition to disable the use of +# coroutines in the headers. +# +string( CONCAT definition_generator + "$<$:STLAB_DISABLE_FUTURE_COROUTINES>" ) + +target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/cmake/stlab/coroutines/Clang.cmake b/cmake/stlab/coroutines/Clang.cmake new file mode 100644 index 000000000..c258a3b88 --- /dev/null +++ b/cmake/stlab/coroutines/Clang.cmake @@ -0,0 +1,40 @@ +# +# If the current compiler doesn't support coroutines and coroutine support +# has been requested, issue a warning indicating the tests will exercise the +# coroutine integration in the stlab library. +# +if( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 + AND stlab.coroutines ) + message( WARNING "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} does not support coroutines." ) + message( STATUS "Coroutines will not be used in testing" ) +endif() + +# +# If the `COROUTINE` property has been established on the target and set +# to `ON` and the Clang compiler version is sufficient to support the +# coroutine TS, return 1. +# +# Otherwise return 0. +# +string( CONCAT active + "$>" + ",$,5>>>" ) + +# +# If using Clang and active, set the coroutines flag +# +string( CONCAT flag_generator + "$<$,${active}>:-fcoroutines>" ) + +target_compile_options( coroutines INTERFACE ${flag_generator} ) + +# +# If using Clang and not active, set a preprocessor definition to disable +# the use of coroutines in the headers. +# +string( CONCAT definition_generator + "$<$,$>" + ":STLAB_DISABLE_FUTURE_COROUTINES>" ) + +target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/cmake/stlab/coroutines/GNU.cmake b/cmake/stlab/coroutines/GNU.cmake new file mode 100644 index 000000000..a51121780 --- /dev/null +++ b/cmake/stlab/coroutines/GNU.cmake @@ -0,0 +1,20 @@ +# +# If the current compiler doesn't support coroutines and coroutine support +# has been requested, issue a warning indicating the tests will exercise the +# coroutine integration in the stlab library. +# +# As of writing, no version of the GNU C++ compiler supports the coroutines TS. +# +if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND stlab.coroutines ) + message( WARNING "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} does not support coroutines." ) + message( STATUS "Coroutines will not be used in testing" ) +endif() + +# +# If using GNU, set a preprocessor definition to disable the use of coroutines +# in the headers. +# +string( CONCAT definition_generator + "$<$:STLAB_DISABLE_FUTURE_COROUTINES>" ) + +target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/cmake/stlab/coroutines/MSVC.cmake b/cmake/stlab/coroutines/MSVC.cmake new file mode 100644 index 000000000..d95193823 --- /dev/null +++ b/cmake/stlab/coroutines/MSVC.cmake @@ -0,0 +1,43 @@ +# +# If the current compiler doesn't support coroutines and coroutine support +# has been requested, issue a warning indicating the tests will exercise the +# coroutine integration in the stlab library. +# +# Note that 2017 is required due to the update to co_yield and co_await from +# yield and await keywords, respectively, used previously in MSVC. +# +if( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2017 + AND stlab.coroutines ) + message( WARNING "${CMAKE_CXX_COMPILER} does not support coroutines (as used by stlab)." ) + message( STATUS "Coroutines will not be used in testing" ) +endif() + +# +# If the `COROUTINE` property has been established on the target and set +# to `ON` and the MSVC compiler version is sufficient to support the +# coroutine TS, return 1. +# +# Otherwise return 0. +# +string( CONCAT activate + "$>" + ",$,2017>>>" ) + +# +# If using MSVC and active, set the coroutines flag +# +string( CONCAT flag_generator + "$<$,${active}>:/await>" ) + +target_compile_options( coroutines INTERFACE ${flag_generator} ) + +# +# If using MSVC and not active, set a preprocessor definition to disable +# the use of coroutines in the headers. +# +string( CONCAT definition_generator + "$<$,$>" + ":STLAB_DISABLE_FUTURE_COROUTINES>" ) + +target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/cmake/stlab/development.cmake b/cmake/stlab/development.cmake index 7ec56c0ec..2390d1404 100644 --- a/cmake/stlab/development.cmake +++ b/cmake/stlab/development.cmake @@ -1,7 +1,7 @@ add_library( development INTERFACE ) add_library( stlab::development ALIAS development ) -include(stlab/development/GNU) -include(stlab/development/Clang) -include(stlab/development/AppleClang) -include(stlab/development/MSVC) +include( stlab/development/AppleClang ) +include( stlab/development/Clang ) +include( stlab/development/GNU ) +include( stlab/development/MSVC ) diff --git a/stlab/concurrency/serial_queue.hpp b/stlab/concurrency/serial_queue.hpp index 065842962..457d1b500 100644 --- a/stlab/concurrency/serial_queue.hpp +++ b/stlab/concurrency/serial_queue.hpp @@ -18,7 +18,9 @@ #include +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif #include #include diff --git a/test/channel_functor_tests.cpp b/test/channel_functor_tests.cpp index 553ad5d34..25ca77e8d 100644 --- a/test/channel_functor_tests.cpp +++ b/test/channel_functor_tests.cpp @@ -8,7 +8,10 @@ #include +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif + #include #include #include diff --git a/test/channel_merge_round_robin_tests.cpp b/test/channel_merge_round_robin_tests.cpp index b9ad2c5a1..b52c0faa2 100644 --- a/test/channel_merge_round_robin_tests.cpp +++ b/test/channel_merge_round_robin_tests.cpp @@ -8,7 +8,9 @@ #include +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif #include #include #include diff --git a/test/channel_merge_unordered_tests.cpp b/test/channel_merge_unordered_tests.cpp index af83b46a9..5e4f75a2d 100644 --- a/test/channel_merge_unordered_tests.cpp +++ b/test/channel_merge_unordered_tests.cpp @@ -8,7 +8,10 @@ #include +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif + #include #include #include diff --git a/test/channel_merge_zip_with_tests.cpp b/test/channel_merge_zip_with_tests.cpp index 9ea464a82..354fe6bf3 100644 --- a/test/channel_merge_zip_with_tests.cpp +++ b/test/channel_merge_zip_with_tests.cpp @@ -8,7 +8,10 @@ #include +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif + #include #include #include diff --git a/test/channel_process_tests.cpp b/test/channel_process_tests.cpp index 4002100d2..603faecb2 100644 --- a/test/channel_process_tests.cpp +++ b/test/channel_process_tests.cpp @@ -8,7 +8,9 @@ #include +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif #include #include diff --git a/test/channel_test_helper.hpp b/test/channel_test_helper.hpp index 21c7c8d71..9d5391b8d 100644 --- a/test/channel_test_helper.hpp +++ b/test/channel_test_helper.hpp @@ -9,7 +9,10 @@ #ifndef CHANNEL_TEST_HELPER_ #define CHANNEL_TEST_HELPER_ +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif + #include #include #include diff --git a/test/channel_tests.cpp b/test/channel_tests.cpp index c8c537922..6268d5090 100644 --- a/test/channel_tests.cpp +++ b/test/channel_tests.cpp @@ -8,7 +8,10 @@ #include +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif + #include #include #include @@ -466,4 +469,4 @@ BOOST_AUTO_TEST_CASE(sender_receiver_swap_tests) { BOOST_REQUIRE_EQUAL(1, result2); BOOST_REQUIRE_EQUAL(2, result1); } -} \ No newline at end of file +} diff --git a/test/tuple_test.cpp b/test/tuple_test.cpp index 05da261fd..d017ff7e8 100644 --- a/test/tuple_test.cpp +++ b/test/tuple_test.cpp @@ -13,7 +13,10 @@ #include // stlab +#ifndef STLAB_DISABLE_FUTURE_COROUTINES #define STLAB_DISABLE_FUTURE_COROUTINES +#endif + #include #include #include From 5a381cd9c4b8485b54e73897b43abf7667165b5f Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Fri, 10 Aug 2018 18:01:50 -0600 Subject: [PATCH 14/61] Update appveyor and added coroutine build to travis --- .appveyor.yml | 2 +- .travis.yml | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 4aa8f3a09..7bc2f92e4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -43,7 +43,7 @@ build_script: - 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 -G "Visual Studio 17 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D stlab.coroutine=ON .. - cmake --build . - test\Debug\stlab.test.channel.test --log_level=message - test\Debug\stlab.test.cow.test --log_level=message diff --git a/.travis.yml b/.travis.yml index 652f44f5b..719c1b5f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ matrix: options="" # - # Linux Clang, Debug & Release + # Linux Clang, Debug & Release, with and without coroutines # - os: linux compiler: clang @@ -70,6 +70,18 @@ matrix: build_type=release options="" + - os: linux + compiler: clang + env: + build_type=debug + options="-Dstlab.coroutines=ON" + + - os: linux + compiler: clang + env: + build_type=release + options="-Dstlab.coroutines=ON" + # # Linux GCC, Debug & Release # From 190779474461a5c89ae221b9bba887106794be98 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Fri, 10 Aug 2018 22:26:51 -0600 Subject: [PATCH 15/61] Added missing file --- cmake/stlab/coroutines.cmake | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cmake/stlab/coroutines.cmake diff --git a/cmake/stlab/coroutines.cmake b/cmake/stlab/coroutines.cmake new file mode 100644 index 000000000..3d3d813d7 --- /dev/null +++ b/cmake/stlab/coroutines.cmake @@ -0,0 +1,28 @@ +add_library( coroutines INTERFACE ) +add_library( stlab::coroutines ALIAS coroutines ) + +include( stlab/coroutines/AppleClang ) +include( stlab/coroutines/Clang ) +include( stlab/coroutines/GNU ) +include( stlab/coroutines/MSVC ) + +if( stlab.coroutines ) + # + # If the `stlab.coroutines` variable is set to `ON`, then a custom target + # interface property `COROUTINES` is established and added to the coroutines + # target and appended to the `COMPATIBLE_INTERFACE_BOOL` property list + # property. The latter step ensures the property will propagate to targets + # linking to the coroutines target. + # + set_target_properties( coroutines PROPERTIES INTERFACE_COROUTINES ON ) + set_property( TARGET coroutines APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL COROUTINES ) +endif() + +# +# If coroutines are not enabled on the target, the minimum C++ version is +# increased to C++17 +# +target_compile_features( coroutines INTERFACE + $<$>:cxx_std_17> ) + + From 33721b3ddde61a751f23ff89b7a1f81ba2b88034 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 07:07:18 -0600 Subject: [PATCH 16/61] corrected error regarding setting dynamic_library typedef for boost --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 624062df6..de8c0171a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,7 +178,7 @@ if ( stlab.testing ) # provided by a shared library rather than a static library. # target_compile_definitions( testing INTERFACE - $<$>:BOOST_TEST_DYN_LINK>) + $<$>:BOOST_TEST_DYN_LINK>) add_subdirectory( test ) endif() From d61349e2021175ed7b0de7a6aa1f58c2d0731217 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 22:08:50 -0600 Subject: [PATCH 17/61] appveyor fix and typos in comments --- .appveyor.yml | 2 +- cmake/stlab/coroutines/AppleClang.cmake | 4 ++-- cmake/stlab/coroutines/Clang.cmake | 4 ++-- cmake/stlab/coroutines/GNU.cmake | 4 ++-- cmake/stlab/coroutines/MSVC.cmake | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7bc2f92e4..e8d9c7f20 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -43,7 +43,7 @@ build_script: - IF EXIST build RMDIR /S /Q build - MKDIR build - cd build - - cmake -G "Visual Studio 17 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D stlab.coroutine=ON .. + - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D stlab.coroutine=ON .. - cmake --build . - test\Debug\stlab.test.channel.test --log_level=message - test\Debug\stlab.test.cow.test --log_level=message diff --git a/cmake/stlab/coroutines/AppleClang.cmake b/cmake/stlab/coroutines/AppleClang.cmake index cb6579c7b..fac219989 100644 --- a/cmake/stlab/coroutines/AppleClang.cmake +++ b/cmake/stlab/coroutines/AppleClang.cmake @@ -1,7 +1,7 @@ # # If the current compiler doesn't support coroutines and coroutine support -# has been requested, issue a warning indicating the tests will exercise the -# coroutine integration in the stlab library. +# has been requested, issue a warning indicating the tests will not exercise +# the coroutine integration in the stlab library. # # As of writing, no version of the Apple Clang (as opposed to the LLVM Clang) # compiler supports the coroutines TS. diff --git a/cmake/stlab/coroutines/Clang.cmake b/cmake/stlab/coroutines/Clang.cmake index c258a3b88..24f0dfa61 100644 --- a/cmake/stlab/coroutines/Clang.cmake +++ b/cmake/stlab/coroutines/Clang.cmake @@ -1,7 +1,7 @@ # # If the current compiler doesn't support coroutines and coroutine support -# has been requested, issue a warning indicating the tests will exercise the -# coroutine integration in the stlab library. +# has been requested, issue a warning indicating the tests will not exercise +# the coroutine integration in the stlab library. # if( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 diff --git a/cmake/stlab/coroutines/GNU.cmake b/cmake/stlab/coroutines/GNU.cmake index a51121780..dbb8d97cb 100644 --- a/cmake/stlab/coroutines/GNU.cmake +++ b/cmake/stlab/coroutines/GNU.cmake @@ -1,7 +1,7 @@ # # If the current compiler doesn't support coroutines and coroutine support -# has been requested, issue a warning indicating the tests will exercise the -# coroutine integration in the stlab library. +# has been requested, issue a warning indicating the tests will not exercise +# the coroutine integration in the stlab library. # # As of writing, no version of the GNU C++ compiler supports the coroutines TS. # diff --git a/cmake/stlab/coroutines/MSVC.cmake b/cmake/stlab/coroutines/MSVC.cmake index d95193823..9eead8c9c 100644 --- a/cmake/stlab/coroutines/MSVC.cmake +++ b/cmake/stlab/coroutines/MSVC.cmake @@ -1,7 +1,7 @@ # # If the current compiler doesn't support coroutines and coroutine support -# has been requested, issue a warning indicating the tests will exercise the -# coroutine integration in the stlab library. +# has been requested, issue a warning indicating the tests will not exercise +# the coroutine integration in the stlab library. # # Note that 2017 is required due to the update to co_yield and co_await from # yield and await keywords, respectively, used previously in MSVC. From c1fe5cc3eba2ac5c13fa78ad5e823730d2777b74 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 22:37:20 -0600 Subject: [PATCH 18/61] removed redundant preprocessor definition from configuration --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de8c0171a..3574ab1a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,8 +143,7 @@ if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) # target_compile_definitions( stlab INTERFACE $<$:STLAB_FORCE_BOOST_OPTIONAL> - $<$:STLAB_FORCE_BOOST_VARIANT> - $<${either_generator}:BOOST_NO_AUTO_PTR=1> ) + $<$:STLAB_FORCE_BOOST_VARIANT> ) unset( either_generator ) endif() From 5e2f771d3266747a24ed227b2f12871a65794d06 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 22:40:58 -0600 Subject: [PATCH 19/61] removed the exclusion of gcc-7.1 --- CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3574ab1a1..6c3d82d3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,17 +16,6 @@ endif() project( stlab VERSION 1.0 LANGUAGES CXX ) -# -# In it's current form, stlab does not compile on the GCC C++ compiler -# from versions earlier than 7.1 as a result of a compiler defect. See -# stlab issue #154 (https://github.com/stlab/libraries/issues/154) for -# more information. -# -if( CMAKE_CXX_COMPILER STREQUAL "GNU" - AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.1" ) - message(FATAL_ERROR "stlab::libraries require g++ version 7.1 or later") -endif() - include( CTest ) include( CMakeDependentOption ) From 05cb87920cd8da02948ea741a7555a03043e21bd Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 23:20:56 -0600 Subject: [PATCH 20/61] Fixing MSVC version for coroutines check. Modify conan include statement. (Temprarily) Disable MSVC coroutines for appveyor --- .appveyor.yml | 10 ++-------- CMakeLists.txt | 2 +- cmake/stlab/coroutines/MSVC.cmake | 4 ++-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index e8d9c7f20..de8643ea2 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -43,12 +43,6 @@ build_script: - IF EXIST build RMDIR /S /Q build - MKDIR build - cd build - - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D stlab.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 + - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. + - ctest -D Experimental -C debug diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c3d82d3a..df2981d90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ add_subdirectory( stlab/concurrency ) if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) - include( conanbuildinfo.cmake ) + include( conanbuildinfo ) # # using the `TARGETS` keyword in the `conan_basic_setup` invocation diff --git a/cmake/stlab/coroutines/MSVC.cmake b/cmake/stlab/coroutines/MSVC.cmake index 9eead8c9c..326c95a35 100644 --- a/cmake/stlab/coroutines/MSVC.cmake +++ b/cmake/stlab/coroutines/MSVC.cmake @@ -7,7 +7,7 @@ # yield and await keywords, respectively, used previously in MSVC. # if( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" - AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2017 + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0 AND stlab.coroutines ) message( WARNING "${CMAKE_CXX_COMPILER} does not support coroutines (as used by stlab)." ) message( STATUS "Coroutines will not be used in testing" ) @@ -22,7 +22,7 @@ endif() # string( CONCAT activate "$>" - ",$,2017>>>" ) + ",$,15.0.0>>>" ) # # If using MSVC and active, set the coroutines flag From 72cdc4387848cc11408cc44cc7f108326dd1d2d4 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 19:29:28 -0600 Subject: [PATCH 21/61] trying to appease the include of conan --- .appveyor.yml | 3 ++- CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index de8643ea2..31529ab3e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -44,5 +44,6 @@ build_script: - MKDIR build - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. - - ctest -D Experimental -C debug + - cmake --build . --config release + - ctest -C release diff --git a/CMakeLists.txt b/CMakeLists.txt index df2981d90..2b4fc1a21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ add_subdirectory( stlab/concurrency ) if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) - include( conanbuildinfo ) + include( ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) # # using the `TARGETS` keyword in the `conan_basic_setup` invocation From c075dcbac62b48a119e07eedf4ec64fe65f40e4e Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 21:12:25 -0600 Subject: [PATCH 22/61] tweaking travis and disabling conan --- .travis.yml | 8 ++++---- .travis/build.sh | 2 +- CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 719c1b5f1..13b2ec745 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ cache: 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" + - 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 packages: - g++-5 @@ -158,8 +158,8 @@ matrix: 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" + - 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 packages: - g++-5 diff --git a/.travis/build.sh b/.travis/build.sh index e4e16db16..8fd2ccaad 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -27,7 +27,7 @@ if [ "$NPROC" == "" ] ; then NPROC=`nproc` fi -if [ ! -z "$flags" ]; then extra_flags="-D stlab_appended_flags=$flags"; fi +if [ ! -z "$flags" ]; then extra_flags="-D CMAKE_CXX_FLAGS=$flags"; fi cmake -D CMAKE_BUILD_TYPE=$build_type $options $extra_flags .. if [ $? -ne 0 ]; then exit 1; fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b4fc1a21..1a84a51dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ target_compile_definitions( stlab INTERFACE $<$:NOMINMAX> add_subdirectory( stlab/concurrency ) if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) - if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) + if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake AND OFF ) include( ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) # From 32b50379a331952a5045198c59abf67ce512dd52 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 21:45:03 -0600 Subject: [PATCH 23/61] semicolon delimit generator expressions and reenable conan --- CMakeLists.txt | 6 +++--- cmake/stlab/development/AppleClang.cmake | 8 ++++---- cmake/stlab/development/Clang.cmake | 8 ++++---- cmake/stlab/development/GNU.cmake | 8 ++++---- cmake/stlab/development/MSVC.cmake | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a84a51dc..4578e4d1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ target_compile_definitions( stlab INTERFACE $<$:NOMINMAX> add_subdirectory( stlab/concurrency ) if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) - if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake AND OFF ) + if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) include( ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake ) # @@ -99,8 +99,8 @@ if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) # We provide aliases to the conan target to mimic the native findBoost # functionality # - add_library( Boost::boost ALIAS CONAN_PKG::Boost ) - add_library( Boost::unit_test_framework ALIAS CONAN_PKG::Boost ) + add_library( Boost::boost ALIAS CONAN_PKG::boost ) + add_library( Boost::unit_test_framework ALIAS CONAN_PKG::boost ) else() # diff --git a/cmake/stlab/development/AppleClang.cmake b/cmake/stlab/development/AppleClang.cmake index 221076617..a2db6a3ae 100644 --- a/cmake/stlab/development/AppleClang.cmake +++ b/cmake/stlab/development/AppleClang.cmake @@ -4,14 +4,14 @@ set( stlab_AppleClang_coverage_flags --coverage ) set( stlab_AppleClang_release_flags ) string(CONCAT generator - "${stlab_AppleClang_base_flags}" + "${stlab_AppleClang_base_flags};" "$<$," - "$>:${stlab_AppleClang_debug_flags}>" + "$>:${stlab_AppleClang_debug_flags};>" "$<$," "$," - "$>:${stlab_AppleClang_release_flags}>" + "$>:${stlab_AppleClang_release_flags};>" "$<$," - "$>:${stlab_AppleClang_debug_flags}>") + "$>:${stlab_AppleClang_debug_flags};>") target_compile_options(development INTERFACE $<$:${generator}>) diff --git a/cmake/stlab/development/Clang.cmake b/cmake/stlab/development/Clang.cmake index 6a691039e..2fb257795 100644 --- a/cmake/stlab/development/Clang.cmake +++ b/cmake/stlab/development/Clang.cmake @@ -4,14 +4,14 @@ set( stlab_Clang_coverage_flags --coverage ) set( stlab_Clang_release_flags ) string(CONCAT generator - "${stlab_Clang_base_flags}" + "${stlab_Clang_base_flags};" "$<$," - "$>:${stlab_Clang_debug_flags}>" + "$>:${stlab_Clang_debug_flags};>" "$<$," "$," - "$>:${stlab_Clang_release_flags}>" + "$>:${stlab_Clang_release_flags};>" "$<$," - "$>:${stlab_Clang_debug_flags}>") + "$>:${stlab_Clang_debug_flags};>") target_compile_options(development INTERFACE $<$:${generator}>) diff --git a/cmake/stlab/development/GNU.cmake b/cmake/stlab/development/GNU.cmake index 0aad116f4..20f8e0049 100644 --- a/cmake/stlab/development/GNU.cmake +++ b/cmake/stlab/development/GNU.cmake @@ -4,14 +4,14 @@ set( stlab_GNU_coverage_flags --coverage ) set( stlab_GNU_release_flags ) string(CONCAT generator - "${stlab_GNU_base_flags}" + "${stlab_GNU_base_flags};" "$<$," - "$>:${stlab_GNU_debug_flags}>" + "$>:${stlab_GNU_debug_flags};>" "$<$," "$," - "$>:${stlab_GNU_release_flags}>" + "$>:${stlab_GNU_release_flags};>" "$<$," - "$>:${stlab_GNU_debug_flags}>") + "$>:${stlab_GNU_debug_flags};>") target_compile_options(development INTERFACE $<$:${generator}>) diff --git a/cmake/stlab/development/MSVC.cmake b/cmake/stlab/development/MSVC.cmake index 6a10330a6..9cddf8bea 100644 --- a/cmake/stlab/development/MSVC.cmake +++ b/cmake/stlab/development/MSVC.cmake @@ -4,14 +4,14 @@ set( stlab_MSVC_coverage_flags ) set( stlab_MSVC_release_flags ) string(CONCAT generator - "${stlab_MSVC_base_flags}" + "${stlab_MSVC_base_flags};" "$<$," - "$>:${stlab_MSVC_debug_flags}>" + "$>:${stlab_MSVC_debug_flags};>" "$<$," "$," - "$>:${stlab_MSVC_release_flags}>" + "$>:${stlab_MSVC_release_flags};>" "$<$," - "$>:${stlab_MSVC_debug_flags}>") + "$>:${stlab_MSVC_debug_flags};>") target_compile_options(development INTERFACE $<$:${generator}>) From ee258960bc08a813f748a9d28652c875229ab00d Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 21:56:08 -0600 Subject: [PATCH 24/61] Working around imported target limitation --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4578e4d1f..98b2a18e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,8 +99,10 @@ if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) # We provide aliases to the conan target to mimic the native findBoost # functionality # - add_library( Boost::boost ALIAS CONAN_PKG::boost ) - add_library( Boost::unit_test_framework ALIAS CONAN_PKG::boost ) + add_library( Boost::boost INTERFACE IMPORTED ) + add_library( Boost::unit_test_framework INTERFACE IMPORTED ) + set_property( TARGET Boost::boost Boost::unit_test_framework + APPEND PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::boost ) else() # From e14fc0db70a1a5803198062e0f394f68fa2cee4b Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 22:07:31 -0600 Subject: [PATCH 25/61] correcting MSVC development generator --- cmake/stlab/development/MSVC.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/stlab/development/MSVC.cmake b/cmake/stlab/development/MSVC.cmake index 9cddf8bea..938d784bf 100644 --- a/cmake/stlab/development/MSVC.cmake +++ b/cmake/stlab/development/MSVC.cmake @@ -14,7 +14,7 @@ string(CONCAT generator "$>:${stlab_MSVC_debug_flags};>") target_compile_options(development INTERFACE - $<$:${generator}>) + $<$:${generator}>) target_link_libraries(development INTERFACE - $<$:${generator}>) + $<$) From 45aafc0288df2f79ab087a9b88bec598b505afac Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 22:16:52 -0600 Subject: [PATCH 26/61] replace missing > in MSVC generator expression --- cmake/stlab/development/MSVC.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/stlab/development/MSVC.cmake b/cmake/stlab/development/MSVC.cmake index 938d784bf..934bb93bf 100644 --- a/cmake/stlab/development/MSVC.cmake +++ b/cmake/stlab/development/MSVC.cmake @@ -17,4 +17,4 @@ target_compile_options(development INTERFACE $<$:${generator}>) target_link_libraries(development INTERFACE - $<$) + $<$:${generator}>) From 0736753eb33d35b3ad261ce24782d492ff829919 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 22:38:50 -0600 Subject: [PATCH 27/61] Capitalization of MSVC config and whitespace delimit extra flags in travis --- .appveyor.yml | 4 ++-- .travis.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 31529ab3e..b676e1900 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -44,6 +44,6 @@ build_script: - MKDIR build - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. - - cmake --build . --config release - - ctest -C release + - cmake --build . --config Release + - ctest -C Release diff --git a/.travis.yml b/.travis.yml index 13b2ec745..f72c6e7a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,7 +104,7 @@ matrix: compiler: clang env: build_type=debug - flags="-fsanitize=address;-fno-omit-frame-pointer;-fno-sanitize-recover=all" + flags="-fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all" options="" # @@ -114,7 +114,7 @@ matrix: compiler: clang env: build_type=debug - flags="-fsanitize=undefined;-fno-omit-frame-pointer;;-fno-sanitize-recover=all" + flags="-fsanitize=undefined -fno-omit-frame-pointer -fno-sanitize-recover=all" options="" # @@ -125,7 +125,7 @@ matrix: env: build_type=debug TSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions" - flags="-fsanitize=thread;-fno-omit-frame-pointer;;-fno-sanitize-recover=all" + flags="-fsanitize=thread -fno-omit-frame-pointer -fno-sanitize-recover=all" options="" # From 24c8757aa1571c597fa75ea397c4037f88bc694f Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 22:45:13 -0600 Subject: [PATCH 28/61] Capitalization bug on MSVC --- cmake/stlab/development/MSVC.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/stlab/development/MSVC.cmake b/cmake/stlab/development/MSVC.cmake index 934bb93bf..fe3fc6047 100644 --- a/cmake/stlab/development/MSVC.cmake +++ b/cmake/stlab/development/MSVC.cmake @@ -1,4 +1,4 @@ -set( stlab_MSVC_base_flags /W4 /Wx ) +set( stlab_MSVC_base_flags /W4 /WX ) set( stlab_MSVC_debug_flags ) set( stlab_MSVC_coverage_flags ) set( stlab_MSVC_release_flags ) From a4732674a61f784bf95c062c4f27d99b8f0d4127 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 22:54:49 -0600 Subject: [PATCH 29/61] removed extraneous semicolon flagged by GCC Wpedantic --- test/serial_queue_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/serial_queue_test.cpp b/test/serial_queue_test.cpp index 4ea90deb2..737ffd51b 100644 --- a/test/serial_queue_test.cpp +++ b/test/serial_queue_test.cpp @@ -86,7 +86,7 @@ inline std::uint64_t str_hash(const std::string& x) { inline std::uint64_t hash_combine(std::uint64_t hash, const std::string& x) { return hash ^ (str_hash(x) << 1); -}; +} /**************************************************************************************************/ From 3ca792f1ee41c51ecea1d666a634e7d2c95f6439 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 23:02:17 -0600 Subject: [PATCH 30/61] turned down MSVC Warning level --- cmake/stlab/development/MSVC.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/stlab/development/MSVC.cmake b/cmake/stlab/development/MSVC.cmake index fe3fc6047..5edf6a89a 100644 --- a/cmake/stlab/development/MSVC.cmake +++ b/cmake/stlab/development/MSVC.cmake @@ -1,4 +1,4 @@ -set( stlab_MSVC_base_flags /W4 /WX ) +set( stlab_MSVC_base_flags /W3 /WX ) set( stlab_MSVC_debug_flags ) set( stlab_MSVC_coverage_flags ) set( stlab_MSVC_release_flags ) From e27254a96c9e5dc375c9377f4a37449a33ee68c2 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 11 Aug 2018 23:06:33 -0600 Subject: [PATCH 31/61] MSVC doesn't consume compile time flags at link time --- cmake/stlab/development/MSVC.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/stlab/development/MSVC.cmake b/cmake/stlab/development/MSVC.cmake index 5edf6a89a..eb39ceb69 100644 --- a/cmake/stlab/development/MSVC.cmake +++ b/cmake/stlab/development/MSVC.cmake @@ -15,6 +15,3 @@ string(CONCAT generator target_compile_options(development INTERFACE $<$:${generator}>) - -target_link_libraries(development INTERFACE - $<$:${generator}>) From 56948a3b597b1a5e82dc3413a06854a66f92b7f3 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 06:34:59 -0600 Subject: [PATCH 32/61] added boost lib directory to user path for appveyor --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index b676e1900..01a53c9a7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -45,5 +45,6 @@ build_script: - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. - cmake --build . --config Release + - pathman /au C:/Libraries/boost_1_65_1/lib - ctest -C Release From 1a23dae66aaf83e539eea488240f8060335cc51b Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 06:42:20 -0600 Subject: [PATCH 33/61] pathman -> setx for appveyor --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 01a53c9a7..66e7dc601 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -45,6 +45,6 @@ build_script: - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. - cmake --build . --config Release - - pathman /au C:/Libraries/boost_1_65_1/lib + - setx "%path%;C:/Libraries/boost_1_65_1/lib" - ctest -C Release From 801c03f248b52960e83f0f7915b30eaa932a5492 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 06:47:46 -0600 Subject: [PATCH 34/61] setx error --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 66e7dc601..b85c0a1f5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -45,6 +45,6 @@ build_script: - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. - cmake --build . --config Release - - setx "%path%;C:/Libraries/boost_1_65_1/lib" + - setx path "%path%;C:/Libraries/boost_1_65_1/lib" - ctest -C Release From a21e12c5ec2e280ea14c89469561f68fe7e1ad7e Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 07:01:08 -0600 Subject: [PATCH 35/61] working around path length limitations --- .appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index b85c0a1f5..83503e80f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -45,6 +45,7 @@ build_script: - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. - cmake --build . --config Release - - setx path "%path%;C:/Libraries/boost_1_65_1/lib" + - mklink /d C:/bl "C:/Libraries/boost_1_65_1/lib" + - setx path "C:/bl;%path%" - ctest -C Release From 4f94d8fdbab3819d0bf0f57d7962a98e0b1dd119 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 07:39:53 -0600 Subject: [PATCH 36/61] dos commands aren't /\ agnostic --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 83503e80f..ba5be32f3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -45,7 +45,7 @@ build_script: - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. - cmake --build . --config Release - - mklink /d C:/bl "C:/Libraries/boost_1_65_1/lib" - - setx path "C:/bl;%path%" + - mklink /d C:\bl "C:/Libraries/boost_1_65_1/lib" + - setx path "C:\bl;%path%" - ctest -C Release From ac705acda0fafb77cefb2516eafea6359b577ff8 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 07:46:13 -0600 Subject: [PATCH 37/61] inspecting appveyor file structure --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index ba5be32f3..4841ef9a0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -41,6 +41,7 @@ install: build_script: - cd C:\projects\libraries - IF EXIST build RMDIR /S /Q build + - dir C:/Libraries/boost_1_65_1 - MKDIR build - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. From 802f03c66ca504cd9e8daa100233e276f414cca4 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 07:49:06 -0600 Subject: [PATCH 38/61] dos and backslashes --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 4841ef9a0..e87e6dc63 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -41,7 +41,7 @@ install: build_script: - cd C:\projects\libraries - IF EXIST build RMDIR /S /Q build - - dir C:/Libraries/boost_1_65_1 + - dir C:\Libraries\boost_1_65_1 - MKDIR build - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. From 7bddd7bfda7374b8fc99c93e9e8b8a23b2b6a8d9 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 07:51:33 -0600 Subject: [PATCH 39/61] more appveyor inspection --- .appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index e87e6dc63..1ef71d4f5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -41,12 +41,14 @@ install: build_script: - cd C:\projects\libraries - IF EXIST build RMDIR /S /Q build - - dir C:\Libraries\boost_1_65_1 + - dir C:\Libraries\boost_1_65_1\libs + - dir C:\Libraries\boost_1_65_1\lib32-msvc-14.1 + - dir C:\Libraries\boost_1_65_1\lib64-msvc-14.1 - MKDIR build - cd build - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. - cmake --build . --config Release - - mklink /d C:\bl "C:/Libraries/boost_1_65_1/lib" + - mklink /d C:\bl "C:\Libraries\boost_1_65_1\lib64-msvc-14.1" - setx path "C:\bl;%path%" - ctest -C Release From f04650a6cef70dd21754c2fbe0e8bb2b58a23985 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 12 Aug 2018 08:15:49 -0600 Subject: [PATCH 40/61] using static libs on appveyor --- .appveyor.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 1ef71d4f5..60ba3dfb4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -41,14 +41,9 @@ install: build_script: - cd C:\projects\libraries - IF EXIST build RMDIR /S /Q build - - dir C:\Libraries\boost_1_65_1\libs - - dir C:\Libraries\boost_1_65_1\lib32-msvc-14.1 - - dir C:\Libraries\boost_1_65_1\lib64-msvc-14.1 - MKDIR build - cd build - - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug .. + - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D Boost_USE_STATIC_LIBS=ON .. - cmake --build . --config Release - - mklink /d C:\bl "C:\Libraries\boost_1_65_1\lib64-msvc-14.1" - - setx path "C:\bl;%path%" - ctest -C Release From df19e0f35c6c18e2098681727738546fc77e4240 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Wed, 15 Aug 2018 20:27:31 -0600 Subject: [PATCH 41/61] re-enabled appveyor coroutines --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 60ba3dfb4..30a876c8d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -43,7 +43,7 @@ build_script: - IF EXIST build RMDIR /S /Q build - MKDIR build - cd build - - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D Boost_USE_STATIC_LIBS=ON .. + - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D Boost_USE_STATIC_LIBS=ON -D stlab.coroutines=ON .. - cmake --build . --config Release - ctest -C Release From c18002ee90afb78d05b3b63561bc05550576426b Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Wed, 15 Aug 2018 20:33:49 -0600 Subject: [PATCH 42/61] disabling cxx-17 deprecation warnings when compiling with msvc coroutines --- cmake/stlab/coroutines/MSVC.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/stlab/coroutines/MSVC.cmake b/cmake/stlab/coroutines/MSVC.cmake index 326c95a35..89c27648f 100644 --- a/cmake/stlab/coroutines/MSVC.cmake +++ b/cmake/stlab/coroutines/MSVC.cmake @@ -38,6 +38,8 @@ target_compile_options( coroutines INTERFACE ${flag_generator} ) # string( CONCAT definition_generator "$<$,$>" - ":STLAB_DISABLE_FUTURE_COROUTINES>" ) + ":STLAB_DISABLE_FUTURE_COROUTINES>" + "$<$,${active}>" + ":_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS>) ) target_compile_definitions( coroutines INTERFACE ${definition_generator} ) From a3e3c0503efd8b1cb144e2e93250077d159019d2 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Wed, 15 Aug 2018 20:35:26 -0600 Subject: [PATCH 43/61] correcting generator expression error --- cmake/stlab/coroutines/MSVC.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/stlab/coroutines/MSVC.cmake b/cmake/stlab/coroutines/MSVC.cmake index 89c27648f..f88219c40 100644 --- a/cmake/stlab/coroutines/MSVC.cmake +++ b/cmake/stlab/coroutines/MSVC.cmake @@ -40,6 +40,6 @@ string( CONCAT definition_generator "$<$,$>" ":STLAB_DISABLE_FUTURE_COROUTINES>" "$<$,${active}>" - ":_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS>) ) + ":_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS>") target_compile_definitions( coroutines INTERFACE ${definition_generator} ) From 4a374aa983e27dd47f6513ee0a985ac1dcb64241 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Wed, 15 Aug 2018 20:39:20 -0600 Subject: [PATCH 44/61] removing coroutines from appveyor build --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 30a876c8d..60ba3dfb4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -43,7 +43,7 @@ build_script: - IF EXIST build RMDIR /S /Q build - MKDIR build - cd build - - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D Boost_USE_STATIC_LIBS=ON -D stlab.coroutines=ON .. + - cmake -G "Visual Studio 15 2017 Win64" -D BOOST_ROOT=C:/Libraries/boost_1_65_1 -D CMAKE_BUILD_TYPE=debug -D Boost_USE_STATIC_LIBS=ON .. - cmake --build . --config Release - ctest -C Release From 11d626a0efaf5e9a574020f976d98a677566c3b1 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 19 Aug 2018 15:09:43 -0600 Subject: [PATCH 45/61] Conditional testing for coroutines --- CMakeLists.txt | 14 +++-- cmake/stlab/coroutines/AppleClang.cmake | 9 ---- cmake/stlab/coroutines/Clang.cmake | 2 +- cmake/stlab/coroutines/GNU.cmake | 9 ---- cmake/stlab/coroutines/MSVC.cmake | 34 +++++++----- stlab/concurrency/CMakeLists.txt | 69 +++++++++++++----------- stlab/concurrency/config.hpp | 4 ++ stlab/concurrency/main_executor.hpp | 2 +- test/CMakeLists.txt | 67 ++++++++++++----------- test/channel_functor_tests.cpp | 4 -- test/channel_merge_round_robin_tests.cpp | 3 -- test/channel_merge_unordered_tests.cpp | 4 -- test/channel_merge_zip_with_tests.cpp | 4 -- test/channel_process_tests.cpp | 4 -- test/channel_test_helper.hpp | 8 +-- test/future_coroutine_tests.cpp | 4 +- 16 files changed, 115 insertions(+), 126 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98b2a18e1..27009b67f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,8 +101,8 @@ if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) # add_library( Boost::boost INTERFACE IMPORTED ) add_library( Boost::unit_test_framework INTERFACE IMPORTED ) - set_property( TARGET Boost::boost Boost::unit_test_framework - APPEND PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::boost ) + set_property( TARGET Boost::boost Boost::unit_test_framework + APPEND PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::boost ) else() # @@ -115,13 +115,19 @@ if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) endif() endif() + + if(NOT TARGET Boost::unit_test_framework) + message(FATAL_ERROR "wtf") + endif() + + string( APPEND either_generator "$," "$>" ) # - # Link to the Boost::boost target is either `stlab.boost_optional` - # or `stlab.boost_variant` are set `ON` which provides the include + # Link to the `Boost::boost` target is either `stlab.boost_optional` + # or `stlab.boost_variant` are set `ON`, which provides the include # directory for the boost header. # target_link_libraries( stlab INTERFACE $<${either_generator}:Boost::boost> ) diff --git a/cmake/stlab/coroutines/AppleClang.cmake b/cmake/stlab/coroutines/AppleClang.cmake index fac219989..9bbae120b 100644 --- a/cmake/stlab/coroutines/AppleClang.cmake +++ b/cmake/stlab/coroutines/AppleClang.cmake @@ -10,12 +10,3 @@ if( CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND stlab.coroutines ) message( WARNING "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} does not support coroutines." ) message( STATUS "Coroutines will not be used in testing" ) endif() - -# -# If using AppleClang, set a preprocessor definition to disable the use of -# coroutines in the headers. -# -string( CONCAT definition_generator - "$<$:STLAB_DISABLE_FUTURE_COROUTINES>" ) - -target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/cmake/stlab/coroutines/Clang.cmake b/cmake/stlab/coroutines/Clang.cmake index 24f0dfa61..7327532c4 100644 --- a/cmake/stlab/coroutines/Clang.cmake +++ b/cmake/stlab/coroutines/Clang.cmake @@ -35,6 +35,6 @@ target_compile_options( coroutines INTERFACE ${flag_generator} ) # string( CONCAT definition_generator "$<$,$>" - ":STLAB_DISABLE_FUTURE_COROUTINES>" ) + ":STLAB_FUTURE_COROUTINES=1>" ) target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/cmake/stlab/coroutines/GNU.cmake b/cmake/stlab/coroutines/GNU.cmake index dbb8d97cb..df408eab9 100644 --- a/cmake/stlab/coroutines/GNU.cmake +++ b/cmake/stlab/coroutines/GNU.cmake @@ -9,12 +9,3 @@ if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND stlab.coroutines ) message( WARNING "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} does not support coroutines." ) message( STATUS "Coroutines will not be used in testing" ) endif() - -# -# If using GNU, set a preprocessor definition to disable the use of coroutines -# in the headers. -# -string( CONCAT definition_generator - "$<$:STLAB_DISABLE_FUTURE_COROUTINES>" ) - -target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/cmake/stlab/coroutines/MSVC.cmake b/cmake/stlab/coroutines/MSVC.cmake index f88219c40..5f68e277e 100644 --- a/cmake/stlab/coroutines/MSVC.cmake +++ b/cmake/stlab/coroutines/MSVC.cmake @@ -3,14 +3,22 @@ # has been requested, issue a warning indicating the tests will not exercise # the coroutine integration in the stlab library. # -# Note that 2017 is required due to the update to co_yield and co_await from -# yield and await keywords, respectively, used previously in MSVC. +# TODO: Version 15.0.0 may be overly restrictive here. The minimum viable MSVC compiler +# version should be explored at some point in the future. # if( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" - AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0 AND stlab.coroutines ) - message( WARNING "${CMAKE_CXX_COMPILER} does not support coroutines (as used by stlab)." ) - message( STATUS "Coroutines will not be used in testing" ) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0) + message( WARNING "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} does not support coroutines (as used by stlab)." ) + message( STATUS "Coroutines will not be used in testing" ) + elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 99.99.99) + # TODO: replace version number + # 99.99.99 is a place holder for a future microsoft compiler version that resolves + # the await/co_await issue in the channels header observed in current MSVC compilers. + message( WARNING "${CMAKE_CXX_COMPILER}-${CMAKE_CXX_COMPILER_VERSION} cannot accomodate the stlab/concurrency/channels header when compiling with coroutines enabled." ) + message( "This header will be excluded from the project definition." ) + message( "The corresponding tests will not be compiled." ) + endif() endif() # @@ -27,19 +35,17 @@ string( CONCAT activate # # If using MSVC and active, set the coroutines flag # -string( CONCAT flag_generator - "$<$,${active}>:/await>" ) - -target_compile_options( coroutines INTERFACE ${flag_generator} ) +target_compile_options( coroutines INTERFACE + $<$,${active}>:/await> ) # -# If using MSVC and not active, set a preprocessor definition to disable -# the use of coroutines in the headers. +# If using MSVC and active, set a preprocessor definition to enable +# the use of coroutines in the headers and disable C++17 depreciation warnings. # string( CONCAT definition_generator - "$<$,$>" - ":STLAB_DISABLE_FUTURE_COROUTINES>" "$<$,${active}>" - ":_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS>") + ":_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;" + "STLAB_FUTURE_COROUTINES=1" + ">" ) target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/stlab/concurrency/CMakeLists.txt b/stlab/concurrency/CMakeLists.txt index c43a307a2..a74c297d7 100644 --- a/stlab/concurrency/CMakeLists.txt +++ b/stlab/concurrency/CMakeLists.txt @@ -1,33 +1,42 @@ +string( CONCAT conditional_exclusion + "$" + ",$,99>" + ",$" + ">" + ">" + ">" ) + target_sources( stlab INTERFACE $ + $<${conditional_exclusion}:${CMAKE_CURRENT_SOURCE_DIR}/channel.hpp> + ${CMAKE_CURRENT_SOURCE_DIR}/config.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/default_executor.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/executor_base.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/future.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/immediate_executor.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/main_executor.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/optional.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/progress.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/system_timer.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/task.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/traits.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/tuple_algorithm.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/utility.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/variant.hpp> $ ) + $<${conditional_exclusion}:include/stlab/concurrency/channel.hpp> + include/stlab/concurrency/channel.hpp + include/stlab/concurrency/config.hpp + include/stlab/concurrency/default_executor.hpp + include/stlab/concurrency/executor_base.hpp + include/stlab/concurrency/future.hpp + include/stlab/concurrency/immediate_executor.hpp + include/stlab/concurrency/main_executor.hpp + include/stlab/concurrency/optional.hpp + include/stlab/concurrency/progress.hpp + include/stlab/concurrency/system_timer.hpp + include/stlab/concurrency/task.hpp + include/stlab/concurrency/traits.hpp + include/stlab/concurrency/tuple_algorithm.hpp + include/stlab/concurrency/utility.hpp + include/stlab/concurrency/variant.hpp> ) diff --git a/stlab/concurrency/config.hpp b/stlab/concurrency/config.hpp index ea7f1134f..80bbdf445 100644 --- a/stlab/concurrency/config.hpp +++ b/stlab/concurrency/config.hpp @@ -65,6 +65,10 @@ #define STLAB_CPP_VERSION 14 #endif +#ifndef STLAB_FUTURE_COROUTINES +#define STLAB_FUTURE_COROUTINES 0 +#endif + /**************************************************************************************************/ #endif diff --git a/stlab/concurrency/main_executor.hpp b/stlab/concurrency/main_executor.hpp index eaeb6c392..1670113f9 100644 --- a/stlab/concurrency/main_executor.hpp +++ b/stlab/concurrency/main_executor.hpp @@ -9,7 +9,7 @@ #ifndef STLAB_CONCURRENCY_MAIN_EXECUTOR_HPP #define STLAB_CONCURRENCY_MAIN_EXECUTOR_HPP -#include "config.hpp" +#include #define STLAB_MAIN_EXECUTOR_LIBDISPATCH 1 #define STLAB_MAIN_EXECUTOR_EMSCRIPTEN 2 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 61e0464b4..fe9420127 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,14 +1,18 @@ -add_executable( stlab.test.channel - channel_functor_tests.cpp - channel_merge_round_robin_tests.cpp - channel_merge_unordered_tests.cpp - channel_merge_zip_with_tests.cpp - channel_process_tests.cpp - channel_test_helper.cpp - channel_tests.cpp - tuple_algorithm_test.cpp - main.cpp - channel_test_helper.hpp ) +if( NOT ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" + AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "99.99.99" + AND stlab.coroutines ) ) + add_executable( stlab.test.channel + channel_functor_tests.cpp + channel_merge_round_robin_tests.cpp + channel_merge_unordered_tests.cpp + channel_merge_zip_with_tests.cpp + channel_process_tests.cpp + channel_test_helper.cpp + channel_tests.cpp + tuple_algorithm_test.cpp + main.cpp + channel_test_helper.hpp ) +endif() target_link_libraries( stlab.test.channel PUBLIC stlab::testing ) add_test( NAME stlab.test.channel COMMAND stlab.test.channel ) @@ -16,26 +20,27 @@ add_test( NAME stlab.test.channel COMMAND stlab.test.channel ) ################################################################################ add_executable( stlab.test.future - future_coroutine_tests.cpp - future_recover_tests.cpp - future_test_helper.cpp - future_tests.cpp - future_then_tests.cpp - future_when_all_arguments_tests.cpp - future_when_all_range_tests.cpp - future_when_any_arguments_tests.cpp - future_when_any_range_tests.cpp - tuple_algorithm_test.cpp - main.cpp - future_test_helper.hpp ) - + future_recover_tests.cpp + future_test_helper.cpp + future_tests.cpp + future_then_tests.cpp + future_when_all_arguments_tests.cpp + future_when_all_range_tests.cpp + future_when_any_arguments_tests.cpp + future_when_any_range_tests.cpp + tuple_algorithm_test.cpp + main.cpp + future_test_helper.hpp ) + +target_sources( stlab.test.future PUBLIC + $<$:future_coroutine_tests.cpp> ) target_link_libraries( stlab.test.future PUBLIC stlab::testing ) add_test( NAME stlab.test.future COMMAND stlab.test.future ) ################################################################################ add_executable( stlab.test.serial_queue - serial_queue_test.cpp ) + serial_queue_test.cpp ) target_link_libraries( stlab.test.serial_queue PUBLIC stlab::testing ) add_test( NAME stlab.test.serial_queue COMMAND stlab.test.serial_queue ) @@ -43,8 +48,8 @@ add_test( NAME stlab.test.serial_queue COMMAND stlab.test.serial_queue ) ################################################################################ add_executable( stlab.test.cow - cow_test.cpp - main.cpp ) + cow_test.cpp + main.cpp ) target_link_libraries( stlab.test.cow PUBLIC stlab::testing ) add_test( NAME stlab.test.cow COMMAND stlab.test.cow ) @@ -52,8 +57,8 @@ add_test( NAME stlab.test.cow COMMAND stlab.test.cow ) ################################################################################ add_executable( stlab.test.task - task_test.cpp - main.cpp ) + task_test.cpp + main.cpp ) target_link_libraries( stlab.test.task PUBLIC stlab::testing ) add_test( NAME stlab.test.task COMMAND stlab.test.task ) @@ -61,8 +66,8 @@ add_test( NAME stlab.test.task COMMAND stlab.test.task ) ################################################################################ add_executable( stlab.test.tuple - tuple_test.cpp - main.cpp ) + tuple_test.cpp + main.cpp ) target_link_libraries( stlab.test.tuple PUBLIC stlab::testing ) add_test( NAME stlab.test.tuple COMMAND stlab.test.tuple ) diff --git a/test/channel_functor_tests.cpp b/test/channel_functor_tests.cpp index 25ca77e8d..44e5f8319 100644 --- a/test/channel_functor_tests.cpp +++ b/test/channel_functor_tests.cpp @@ -8,10 +8,6 @@ #include -#ifndef STLAB_DISABLE_FUTURE_COROUTINES -#define STLAB_DISABLE_FUTURE_COROUTINES -#endif - #include #include #include diff --git a/test/channel_merge_round_robin_tests.cpp b/test/channel_merge_round_robin_tests.cpp index b52c0faa2..fc8a233eb 100644 --- a/test/channel_merge_round_robin_tests.cpp +++ b/test/channel_merge_round_robin_tests.cpp @@ -8,9 +8,6 @@ #include -#ifndef STLAB_DISABLE_FUTURE_COROUTINES -#define STLAB_DISABLE_FUTURE_COROUTINES -#endif #include #include #include diff --git a/test/channel_merge_unordered_tests.cpp b/test/channel_merge_unordered_tests.cpp index 5e4f75a2d..bc5f35734 100644 --- a/test/channel_merge_unordered_tests.cpp +++ b/test/channel_merge_unordered_tests.cpp @@ -8,10 +8,6 @@ #include -#ifndef STLAB_DISABLE_FUTURE_COROUTINES -#define STLAB_DISABLE_FUTURE_COROUTINES -#endif - #include #include #include diff --git a/test/channel_merge_zip_with_tests.cpp b/test/channel_merge_zip_with_tests.cpp index 354fe6bf3..699b4ff8a 100644 --- a/test/channel_merge_zip_with_tests.cpp +++ b/test/channel_merge_zip_with_tests.cpp @@ -8,10 +8,6 @@ #include -#ifndef STLAB_DISABLE_FUTURE_COROUTINES -#define STLAB_DISABLE_FUTURE_COROUTINES -#endif - #include #include #include diff --git a/test/channel_process_tests.cpp b/test/channel_process_tests.cpp index 603faecb2..1d761b0a1 100644 --- a/test/channel_process_tests.cpp +++ b/test/channel_process_tests.cpp @@ -8,10 +8,6 @@ #include -#ifndef STLAB_DISABLE_FUTURE_COROUTINES -#define STLAB_DISABLE_FUTURE_COROUTINES -#endif - #include #include #include diff --git a/test/channel_test_helper.hpp b/test/channel_test_helper.hpp index 9d5391b8d..d5e5705fe 100644 --- a/test/channel_test_helper.hpp +++ b/test/channel_test_helper.hpp @@ -6,12 +6,8 @@ /**************************************************************************************************/ -#ifndef CHANNEL_TEST_HELPER_ -#define CHANNEL_TEST_HELPER_ - -#ifndef STLAB_DISABLE_FUTURE_COROUTINES -#define STLAB_DISABLE_FUTURE_COROUTINES -#endif +#ifndef CHANNEL_TEST_HELPER +#define CHANNEL_TEST_HELPER #include #include diff --git a/test/future_coroutine_tests.cpp b/test/future_coroutine_tests.cpp index f17e65cc7..2fd11904b 100644 --- a/test/future_coroutine_tests.cpp +++ b/test/future_coroutine_tests.cpp @@ -18,7 +18,7 @@ #include "future_test_helper.hpp" -#ifdef STLAB_FUTURE_COROUTINE_SUPPORT +#if STLAB_FUTURE_COROUTINES using namespace stlab; using namespace future_test_helper; @@ -117,4 +117,4 @@ BOOST_AUTO_TEST_CASE(future_coroutine_combined_void_int) { BOOST_REQUIRE(boolCheck.load()); } -#endif \ No newline at end of file +#endif From 25def1162a8a2c8261d707ba2ff7519a71b6e201 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 19 Aug 2018 15:14:28 -0600 Subject: [PATCH 46/61] Generator expression correction --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fe9420127..1fdeaea3e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -33,7 +33,7 @@ add_executable( stlab.test.future future_test_helper.hpp ) target_sources( stlab.test.future PUBLIC - $<$:future_coroutine_tests.cpp> ) + $<$>:future_coroutine_tests.cpp> ) target_link_libraries( stlab.test.future PUBLIC stlab::testing ) add_test( NAME stlab.test.future COMMAND stlab.test.future ) From 469049a74fe320e927520f01746cb16fdaa6aa3d Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 19 Aug 2018 15:19:02 -0600 Subject: [PATCH 47/61] removed redundant preprocessor definition --- stlab/concurrency/future.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stlab/concurrency/future.hpp b/stlab/concurrency/future.hpp index e33815ded..237bf8be7 100644 --- a/stlab/concurrency/future.hpp +++ b/stlab/concurrency/future.hpp @@ -30,11 +30,10 @@ // as long as VS 2017 still accepts await as keyword, it is necessary to disable coroutine // support for the channels tests #ifdef __has_include -#if __has_include() && !defined(STLAB_DISABLE_FUTURE_COROUTINES) +#if __has_include() && STLAB_FUTURE_COROUTINES) #include #include #include -#define STLAB_FUTURE_COROUTINE_SUPPORT #endif #endif @@ -1732,7 +1731,7 @@ auto shared_base::reduce(future>&& r) -> future { /**************************************************************************************************/ -#ifdef STLAB_FUTURE_COROUTINE_SUPPORT +#ifdef STLAB_FUTURE_COROUTINES template struct std::experimental::coroutine_traits, Args...> { From 93385b094eb47c44ea72b4a5753480aa841c6702 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 19 Aug 2018 15:20:55 -0600 Subject: [PATCH 48/61] removed unmatched parenthesis --- stlab/concurrency/future.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stlab/concurrency/future.hpp b/stlab/concurrency/future.hpp index 237bf8be7..985634d37 100644 --- a/stlab/concurrency/future.hpp +++ b/stlab/concurrency/future.hpp @@ -30,7 +30,7 @@ // as long as VS 2017 still accepts await as keyword, it is necessary to disable coroutine // support for the channels tests #ifdef __has_include -#if __has_include() && STLAB_FUTURE_COROUTINES) +#if __has_include() && STLAB_FUTURE_COROUTINES #include #include #include From 149ff7d130bb5232290aa24e552cb5a88db0a761 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sun, 19 Aug 2018 15:38:43 -0600 Subject: [PATCH 49/61] ifdef to if --- cmake/stlab/coroutines/MSVC.cmake | 6 ++++-- stlab/concurrency/future.hpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/stlab/coroutines/MSVC.cmake b/cmake/stlab/coroutines/MSVC.cmake index 5f68e277e..7bc4550ab 100644 --- a/cmake/stlab/coroutines/MSVC.cmake +++ b/cmake/stlab/coroutines/MSVC.cmake @@ -30,7 +30,9 @@ endif() # string( CONCAT activate "$>" - ",$,15.0.0>>>" ) + ",$,15.0.0>" + ">" + ">" ) # # If using MSVC and active, set the coroutines flag @@ -45,7 +47,7 @@ target_compile_options( coroutines INTERFACE string( CONCAT definition_generator "$<$,${active}>" ":_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;" - "STLAB_FUTURE_COROUTINES=1" + "STLAB_FUTURE_COROUTINES=1;" ">" ) target_compile_definitions( coroutines INTERFACE ${definition_generator} ) diff --git a/stlab/concurrency/future.hpp b/stlab/concurrency/future.hpp index 985634d37..f75c0cf92 100644 --- a/stlab/concurrency/future.hpp +++ b/stlab/concurrency/future.hpp @@ -31,6 +31,7 @@ // support for the channels tests #ifdef __has_include #if __has_include() && STLAB_FUTURE_COROUTINES +#define STLAB_FUTURE_COROUTINES_SUPPORT #include #include #include @@ -1731,7 +1732,7 @@ auto shared_base::reduce(future>&& r) -> future { /**************************************************************************************************/ -#ifdef STLAB_FUTURE_COROUTINES +#if STLAB_FUTURE_COROUTINES_SUPPORT template struct std::experimental::coroutine_traits, Args...> { From d23d1363bb7bb2baa04133da6afeb51bbc97d813 Mon Sep 17 00:00:00 2001 From: Aaron Albers Date: Wed, 22 Aug 2018 17:07:59 -0600 Subject: [PATCH 50/61] Lock the condition - Updated varients of `blocking_get()` to properly `notify_one()` under lock. This brings them into alignment with the other versions of `blocking_get()` --- stlab/concurrency/utility.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stlab/concurrency/utility.hpp b/stlab/concurrency/utility.hpp index c46b19aba..2db5f8a42 100644 --- a/stlab/concurrency/utility.hpp +++ b/stlab/concurrency/utility.hpp @@ -130,8 +130,8 @@ stlab::optional blocking_get(future x, const std::chrono::nanoseconds& tim { std::unique_lock lock{state->m}; state->flag = true; + state->condition.notify_one(); } - state->condition.notify_one(); }); { @@ -185,8 +185,8 @@ inline bool blocking_get(future x, const std::chrono::nanoseconds& timeout { std::unique_lock lock(state->m); state->flag = true; + state->condition.notify_one(); } - state->condition.notify_one(); }); { From 454ba56962f825df5e7616b34ad6dee90b6b0d33 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 17 Sep 2018 12:34:20 +0200 Subject: [PATCH 51/61] Find the Threads lib for the exported cmake package --- cmake/stlabConfig.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/stlabConfig.cmake b/cmake/stlabConfig.cmake index d83047040..c1ac25e6e 100644 --- a/cmake/stlabConfig.cmake +++ b/cmake/stlabConfig.cmake @@ -1,3 +1,4 @@ include( CMakeFindDependencyMacro ) find_dependency( Boost 1.60.0 REQUIRED COMPONENTS unit_test_framework ) +find_package(Threads REQUIRED) include( "${CMAKE_CURRENT_LIST_DIR}/stlabTargets.cmake" ) From 83281cdf630f2e85626c0634acdd61c1149d79bc Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 17 Sep 2018 12:38:12 +0200 Subject: [PATCH 52/61] Do not find the boost test framework when importing stlab from another project --- cmake/stlabConfig.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/stlabConfig.cmake b/cmake/stlabConfig.cmake index c1ac25e6e..f09e623bc 100644 --- a/cmake/stlabConfig.cmake +++ b/cmake/stlabConfig.cmake @@ -1,4 +1,3 @@ include( CMakeFindDependencyMacro ) -find_dependency( Boost 1.60.0 REQUIRED COMPONENTS unit_test_framework ) find_package(Threads REQUIRED) include( "${CMAKE_CURRENT_LIST_DIR}/stlabTargets.cmake" ) From b3ccbdb5a27328da11de9a19c0b8ac53221e5ff5 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 17 Sep 2018 14:28:27 +0200 Subject: [PATCH 53/61] Use the find_dependency macro both for Boost and Threads in stlabConfig.cmake --- cmake/stlabConfig.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/stlabConfig.cmake b/cmake/stlabConfig.cmake index f09e623bc..f90f3bf9c 100644 --- a/cmake/stlabConfig.cmake +++ b/cmake/stlabConfig.cmake @@ -1,3 +1,4 @@ include( CMakeFindDependencyMacro ) -find_package(Threads REQUIRED) +find_dependency(Boost 1.60.0) +find_dependency(Threads) include( "${CMAKE_CURRENT_LIST_DIR}/stlabTargets.cmake" ) From 8a1aeb7c0bfa9a61c5d953b245471de277e0ce78 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 17 Sep 2018 14:29:14 +0200 Subject: [PATCH 54/61] Write out very long generator expression And by doing that, fix the cmake error about a missing channel.hpp on macOS. --- stlab/concurrency/CMakeLists.txt | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/stlab/concurrency/CMakeLists.txt b/stlab/concurrency/CMakeLists.txt index a74c297d7..7cbd45ecf 100644 --- a/stlab/concurrency/CMakeLists.txt +++ b/stlab/concurrency/CMakeLists.txt @@ -1,14 +1,5 @@ -string( CONCAT conditional_exclusion - "$" - ",$,99>" - ",$" - ">" - ">" - ">" ) - target_sources( stlab INTERFACE $ ${CMAKE_CURRENT_SOURCE_DIR}/config.hpp ${CMAKE_CURRENT_SOURCE_DIR}/default_executor.hpp ${CMAKE_CURRENT_SOURCE_DIR}/executor_base.hpp @@ -24,7 +15,6 @@ target_sources( stlab INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/utility.hpp ${CMAKE_CURRENT_SOURCE_DIR}/variant.hpp> $ include/stlab/concurrency/channel.hpp include/stlab/concurrency/config.hpp include/stlab/concurrency/default_executor.hpp @@ -39,4 +29,18 @@ target_sources( stlab INTERFACE include/stlab/concurrency/traits.hpp include/stlab/concurrency/tuple_algorithm.hpp include/stlab/concurrency/utility.hpp - include/stlab/concurrency/variant.hpp> ) + include/stlab/concurrency/variant.hpp>) + +if(CXX_COMPILER_ID MATCHES MSVC) + if(CXX_COMPILER_VERSION VERSION_LESS 99) + get_target_property(wants_coroutines stlab COROUTINES) + if(wants_coroutines) + message(STATUS "Not including concurrency/channel.hpp in the target sources for stlab") + return() + endif() + endif() +endif() + +target_sources(stlab INTERFACE + $ + $) From 2d441876fbcd7325926168e08a05a81686fde8bb Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Mon, 17 Sep 2018 22:04:15 +0200 Subject: [PATCH 55/61] Correct clang co-routine flag --- cmake/stlab/coroutines/Clang.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/stlab/coroutines/Clang.cmake b/cmake/stlab/coroutines/Clang.cmake index 7327532c4..d9c902d84 100644 --- a/cmake/stlab/coroutines/Clang.cmake +++ b/cmake/stlab/coroutines/Clang.cmake @@ -25,7 +25,7 @@ string( CONCAT active # If using Clang and active, set the coroutines flag # string( CONCAT flag_generator - "$<$,${active}>:-fcoroutines>" ) + "$<$,${active}>:-fcoroutines-ts>" ) target_compile_options( coroutines INTERFACE ${flag_generator} ) From 536109c5df88ce6a5075a32a6002f8d5c3187bc7 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Mon, 17 Sep 2018 22:18:55 +0200 Subject: [PATCH 56/61] Disable co routine builds temporarily --- .travis.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index f72c6e7a7..e90c93ef6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,17 +70,17 @@ matrix: build_type=release options="" - - os: linux - compiler: clang - env: - build_type=debug - options="-Dstlab.coroutines=ON" - - - os: linux - compiler: clang - env: - build_type=release - options="-Dstlab.coroutines=ON" +# - os: linux +# compiler: clang +# env: +# build_type=debug +# options="-Dstlab.coroutines=ON" +# +# - os: linux +# compiler: clang +# env: +# build_type=release +# options="-Dstlab.coroutines=ON" # # Linux GCC, Debug & Release From b04683d3127d89b1958a3dfabe908e71477c3ff8 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Wed, 10 Oct 2018 19:09:21 +0200 Subject: [PATCH 57/61] Try to fix Mac builds --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e90c93ef6..f111731db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ matrix: - brew upgrade python - brew uninstall libyaml - pip3 install --no-cache-dir pyyaml - - pip3 install conan + - pip3 install --user conan - ./enhance_conan.sh env: @@ -48,7 +48,7 @@ matrix: - brew upgrade python - brew uninstall libyaml - pip3 install --no-cache-dir pyyaml - - pip3 install conan + - pip3 install --user conan - ./enhance_conan.sh env: From a44656d15dd3b22338ff05ffcb6a79d7b2958e60 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Wed, 10 Oct 2018 20:05:39 +0200 Subject: [PATCH 58/61] Expand the path for python3 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index f111731db..ad57b7eb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ matrix: - brew uninstall libyaml - pip3 install --no-cache-dir pyyaml - pip3 install --user conan + - export PATH=$PATH:/Users/travis/Library/Python/3.7/bin - ./enhance_conan.sh env: @@ -49,6 +50,7 @@ matrix: - brew uninstall libyaml - pip3 install --no-cache-dir pyyaml - pip3 install --user conan + - export PATH=$PATH:/Users/travis/Library/Python/3.7/bin - ./enhance_conan.sh env: From cfc46222365177571fd049a7ddeacff80b3fffed Mon Sep 17 00:00:00 2001 From: superfunc Date: Sat, 20 Oct 2018 11:08:01 -0700 Subject: [PATCH 59/61] Fixup cmake error message --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27009b67f..7e0fb17ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,7 @@ if ( stlab.testing OR stlab.boost_variant OR stlab.boost_optional ) if(NOT TARGET Boost::unit_test_framework) - message(FATAL_ERROR "wtf") + message(FATAL_ERROR "Could not find Boost unit test framework.") endif() From 4f26ab2fb123d5091d4f45cb9aa8043c6c845f00 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Wed, 24 Oct 2018 07:42:42 +0200 Subject: [PATCH 60/61] Add draft of release note --- CHANGES.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f2ac931da..7cc228722 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +## v1.3.3 - 2018 - October - 25 + +- Fixed Issues + - [#154](https://github.com/stlab/libraries/issues/154) : + - Race condition in blockin_get(future, const std::chrono::nanoseconds&) + +- Enhancedments + - The library can now be included as cmake dependency (Many thanks to Austin McCartney) + ## v1.3.2 - 2018 - July - 28 - Fixed Issues From 1951fddc37b3666b1c3df345873719a05d154619 Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Thu, 25 Oct 2018 17:28:56 +0200 Subject: [PATCH 61/61] Add release notes and bump to new version --- CHANGES.md | 9 +++++++++ stlab/version.hpp | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f2ac931da..4f24b7d57 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +## v1.3.3 - 2018 - October - 25 + +- Fixed Issues + - [#154](https://github.com/stlab/libraries/issues/154) : Compilation error with gcc + - Race condition in timed blocking_get + +- Enhancements: + - Add cmake support as library (Many thanks to Austin McCartney!) + ## v1.3.2 - 2018 - July - 28 - Fixed Issues diff --git a/stlab/version.hpp b/stlab/version.hpp index 568ba7234..74f86ee65 100644 --- a/stlab/version.hpp +++ b/stlab/version.hpp @@ -19,13 +19,13 @@ // STLAB_VERSION / 100 % 1000 is the minor version // STLAB_VERSION / 100000 is the major version -#define STLAB_VERSION 100302 +#define STLAB_VERSION 100303 // // STLAB_LIB_VERSION must be defined to be the same as STLAB_VERSION // but as a *string* in the form "x_y[_z]" where x is the major version // number, y is the minor version number, and z is the patch level if not 0. -#define STLAB_LIB_VERSION "1_3_2" +#define STLAB_LIB_VERSION "1_3_3" #endif