Skip to content

Commit

Permalink
Merge branch 'main' into reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
danlapid committed Feb 10, 2024
2 parents 0b3c047 + 1971fca commit 4d15ebf
Show file tree
Hide file tree
Showing 18 changed files with 194 additions and 35 deletions.
172 changes: 159 additions & 13 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CMake

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
build:
Expand All @@ -17,15 +21,15 @@ jobs:
config:
- {
name: "Linux g++ 10.2 C++17",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "g++-10",
cxxver: 17,
generator: "Unix Makefiles",
}
- {
name: "Linux g++ 10.2 C++20",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "g++-10",
cxxver: 20,
Expand All @@ -49,20 +53,48 @@ jobs:
}
- {
name: "Linux g++ 11 C++17",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Debug,
cxx: "g++-11",
cxxver: 17,
generator: "Unix Makefiles",
}
- {
name: "Linux g++ 11 C++20",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "g++-11",
cxxver: 20,
generator: "Unix Makefiles",
}
- {
name: "Linux g++ 12 C++17",
os: ubuntu-22.04,
buildtype: Release,
cxx: "g++-12",
cxxver: 17,
}
- {
name: "Linux g++ 12 C++20",
os: ubuntu-22.04,
buildtype: Release,
cxx: "g++-12",
cxxver: 20,
}
- {
name: "Linux g++ 13 C++17",
os: ubuntu-22.04,
buildtype: Release,
cxx: "g++-13",
cxxver: 17,
}
- {
name: "Linux g++ 13 C++20",
os: ubuntu-22.04,
buildtype: Release,
cxx: "g++-13",
cxxver: 20,
}
- {
name: "Linux clang-10 C++17",
os: ubuntu-20.04,
Expand Down Expand Up @@ -125,7 +157,7 @@ jobs:
}
- {
name: "Linux clang-13 C++17",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "clang++-13",
cxx_flags: -stdlib=libc++,
Expand All @@ -135,7 +167,7 @@ jobs:
}
- {
name: "Linux clang-13 C++20",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "clang++-13",
cxx_flags: -stdlib=libc++,
Expand All @@ -145,7 +177,7 @@ jobs:
}
- {
name: "Linux clang-14 C++17",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "clang++-14",
cxx_flags: -stdlib=libc++,
Expand All @@ -155,7 +187,7 @@ jobs:
}
- {
name: "Linux clang-14 C++20",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "clang++-14",
cxx_flags: -stdlib=libc++,
Expand All @@ -165,7 +197,7 @@ jobs:
}
- {
name: "Linux clang-15 C++17 Debug",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Debug,
cxx: "clang++-15",
cxx_flags: -stdlib=libc++,
Expand All @@ -175,7 +207,7 @@ jobs:
}
- {
name: "Linux clang-15 C++20 Debug",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Debug,
cxx: "clang++-15",
cxx_flags: -stdlib=libc++,
Expand All @@ -185,7 +217,7 @@ jobs:
}
- {
name: "Linux clang-15 C++17",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "clang++-15",
cxx_flags: -stdlib=libc++,
Expand All @@ -195,14 +227,32 @@ jobs:
}
- {
name: "Linux clang-15 C++20",
os: ubuntu-20.04,
os: ubuntu-22.04,
buildtype: Release,
cxx: "clang++-15",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
generator: "Unix Makefiles",
}
- {
name: "Linux clang-16 C++17",
os: ubuntu-22.04,
buildtype: Release,
cxx: "clang++-16",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 17,
}
- {
name: "Linux clang-16 C++20",
os: ubuntu-22.04,
buildtype: Release,
cxx: "clang++-16",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
}
- {
name: "Windows MSVC 2017 (x64) C++17",
os: windows-2019,
Expand Down Expand Up @@ -355,9 +405,58 @@ jobs:
cxxver: 20,
generator: "Unix Makefiles",
}
- {
name: "Msys2/CLANG",
os: windows-2019,
buildtype: Release,
mingw: MINGW64,
mingw-arch: x86_64,
cxx: "clang",
cxxver: 20,
}
- {
name: "Msys2/GCC",
os: windows-2019,
buildtype: Release,
mingw: MINGW64,
mingw-arch: x86_64,
cxx: "gcc",
cxxver: 20,
}
- {
name: "Msys2/debugCLANG",
os: windows-2019,
buildtype: Debug,
mingw: MINGW64,
mingw-arch: x86_64,
cxx: "clang",
cxxver: 17,
}
- {
name: "Msys2/debugGCC",
os: windows-2019,
buildtype: Debug,
mingw: MINGW64,
mingw-arch: x86_64,
cxx: "gcc",
cxxver: 17,
}

steps:
- uses: actions/checkout@v3

- name: "Install Msys2"
if: (startsWith(matrix.config.os, 'windows-2019') && contains(matrix.config.mingw, 'MINGW'))
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.mingw }}
install: >-
git
mingw-w64-${{ matrix.config.mingw-arch }}-cmake
mingw-w64-${{ matrix.config.mingw-arch }}-ninja
mingw-w64-${{ matrix.config.mingw-arch }}-${{ matrix.config.cxx }}
mingw-w64-${{ matrix.config.mingw-arch }}-toolchain
update: true

- name: Install Clang 10
id: install_clang_10
Expand Down Expand Up @@ -425,6 +524,17 @@ jobs:
sudo ./llvm.sh 15
sudo apt-get install libc++-15-dev libc++abi-15-dev libunwind-15-dev
- name: Install Clang 16
id: install_clang_16
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-16' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
sudo apt-get install libc++-16-dev libc++abi-16-dev libunwind-16-dev
- name: Install g++ 10
id: install_gcc_10
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-10' )
Expand All @@ -443,6 +553,23 @@ jobs:
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt-get install g++-11
- name: Install g++ 12
id: install_gcc_12
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-12' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install g++-12
- name: Install g++ 13
id: install_gcc_13
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-13' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt-get install g++-13
- name: Install MSVC 2017
id: install_msvc_2017
if: startsWith(matrix.config.os, 'windows-2019') && ( matrix.config.cxx == 'cl' ) && ( matrix.config.msvcver == 2017 )
Expand Down Expand Up @@ -472,13 +599,30 @@ jobs:
choco uninstall strawberryperl --force
choco install mingw --version=11.2.0.07112021
choco install make
- name: MSYS2 - Configure, Build & Test
id: install_msys2
if: (startsWith(matrix.config.os, 'windows-2019') && contains(matrix.config.mingw, 'MINGW'))
shell: msys2 {0}
working-directory: ${{ env.HOME }}
run: |
cmake $GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{ matrix.config.buildtype }} \
-DCMAKE_CXX_STANDARD=${{ matrix.config.cxxver }} \
-DBUILD_TESTING=ON \
-DCMAKE_CXX_FLAGS=${{ matrix.config.cxx_flags }} \
-DCMAKE_EXE_LINKER_FLAGS=${{ matrix.config.exe_linker_flags }} \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build . --config ${{ matrix.config.buildtype }}
ctest --output-on-failure -C ${{ matrix.config.buildtype }}
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake
if: (!contains(matrix.config.mingw, 'MINGW'))
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
Expand All @@ -502,12 +646,14 @@ jobs:
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: Build
if: (!contains(matrix.config.mingw, 'MINGW'))
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config ${{ matrix.config.buildtype }}

- name: Test
if: (!contains(matrix.config.mingw, 'MINGW'))
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ library. The differences to the original cppcoro are:
* CMake as build system instead of cake.
* CI in Github actions instead of appveyor

andreasbuhr/cppcoro is currently tested with g++-10.2, g++-11.1, clang-10, clang-11, clang-12, clang-13, clang-14, clang-15, MSVC-2017, MSVC-2019, and MSVC-2022.
andreasbuhr/cppcoro is currently tested with g++-10.2, g++-11.1, g++-12, g+-13, clang-10, clang-11, clang-12, clang-13, clang-14, clang-15, clang-16, MSVC-2017, MSVC-2019, and MSVC-2022.
Current build status for master branch: [![Actions Status](https://github.com/andreasbuhr/cppcoro/workflows/CMake/badge.svg)](https://github.com/andreasbuhr/cppcoro/actions).

Most of the changes are offered upstream:
Expand Down
3 changes: 3 additions & 0 deletions include/cppcoro/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
/// 0x0602 - Windows 8
/// 0x0603 - Windows 8.1
/// 0x0A00 - Windows 10
#ifdef __MINGW32__
#define SCOPEID_UNSPECIFIED_INIT {0}
#endif
#if defined(_WIN32_WINNT) || defined(_WIN32)
# if !defined(_WIN32_WINNT)
// Default to targeting Windows 10 if not defined.
Expand Down
1 change: 1 addition & 0 deletions include/cppcoro/detail/when_all_ready_awaitable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <cppcoro/coroutine.hpp>
#include <tuple>
#include <initializer_list>

namespace cppcoro
{
Expand Down
2 changes: 1 addition & 1 deletion include/cppcoro/detail/win32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace cppcoro
#endif

/// Structure needs to correspond exactly to the builtin
/// _OVERLAPPED structure from Windows.h.
/// _OVERLAPPED structure from windows.h.
struct overlapped
{
ulongptr_t Internal;
Expand Down
4 changes: 2 additions & 2 deletions include/cppcoro/generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ namespace cppcoro

private:

pointer_type m_value;
std::exception_ptr m_exception;
pointer_type m_value{};
std::exception_ptr m_exception{};

};

Expand Down
3 changes: 2 additions & 1 deletion include/cppcoro/resume_on.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ namespace cppcoro
template<typename SCHEDULER, typename T>
async_generator<T> resume_on(SCHEDULER& scheduler, async_generator<T> source)
{
for (auto iter = co_await source.begin(); iter != source.end();)
for (detail::async_generator_iterator<T> iter = co_await source.begin(); iter != source.end();)
{
auto& value = *iter;
co_await scheduler.schedule();
co_yield value;
co_await ++iter; // moved due to error: insufficient contextual information to determine type on old compilers
}
}

}

#endif
Loading

0 comments on commit 4d15ebf

Please sign in to comment.