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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Codeowners for reviews on PRs

# Note(river):
# **Please understand how codeowner file work before uncommenting anything in this section:**
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
#
# For projects using exemplar as a template and intend to reuse its infrastructure,
# River (@wusatosi) helped create most of the original infrastructure under the scope described below,
# they are more than happy to help out with any PRs downstream,
# as well as to sync any useful change upstream to exemplar.
#
# Github Actions:
# .github/workflows/ @wusatosi # Add other project owners here
#
Expand Down
37 changes: 17 additions & 20 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- description: "Windows MSVC"
os: windows-latest
toolchain: "cmake/msvc-toolchain.cmake"
cpp_version: [17, 20, 23, 26]
cpp_version: [20, 23, 26]
cmake_args:
- description: "Default"
- description: "TSan"
Expand All @@ -70,15 +70,15 @@ jobs:
description: "Ubuntu GCC"
os: ubuntu-latest
toolchain: "cmake/gnu-toolchain.cmake"
cpp_version: 17
cpp_version: 23
cmake_args:
description: "Werror"
args: "-DCMAKE_CXX_FLAGS='-Werror=all -Werror=extra'"
- platform:
description: "Ubuntu GCC"
os: ubuntu-latest
toolchain: "cmake/gnu-toolchain.cmake"
cpp_version: 17
cpp_version: 23
cmake_args:
description: "Dynamic"
args: "-DBUILD_SHARED_LIBS=on"
Expand Down Expand Up @@ -119,17 +119,17 @@ jobs:
# Portable commands only
cmake --build build --config Release --verbose
cmake --build build --config Release --target all_verify_interface_header_sets
cmake --install build --config Release --prefix /opt/beman.exemplar
ls -R /opt/beman.exemplar
cmake --install build --config Release --prefix /opt/beman.lazy
ls -R /opt/beman.lazy
- name: Test Release
run: ctest --test-dir build --build-config Release
- name: Build Debug
run: |
# Portable commands only
cmake --build build --config Debug --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
ls -R /opt/beman.exemplar
cmake --install build --config Debug --prefix /opt/beman.lazy
ls -R /opt/beman.lazy
- name: Test Debug
run: ctest --test-dir build --build-config Debug

Expand All @@ -139,9 +139,9 @@ jobs:
matrix:
args:
- name: "Disable build testing"
arg: "-DBEMAN_EXEMPLAR_BUILD_TESTS=OFF"
arg: "-DBEMAN_LAZY_BUILD_TESTS=OFF"
- name: "Disable example building"
arg: "-DBEMAN_EXEMPLAR_BUILD_EXAMPLES=OFF"
arg: "-DBEMAN_LAZY_BUILD_EXAMPLES=OFF"
name: "CMake: ${{ matrix.args.name }}"
steps:
- uses: actions/checkout@v4
Expand All @@ -156,43 +156,40 @@ jobs:
ninja --version
- name: Configure CMake
run: |
cmake -B build -S . -DCMAKE_CXX_STANDARD=17 ${{ matrix.args.arg }}
cmake -B build -S . -DCMAKE_CXX_STANDARD=23 ${{ matrix.args.arg }}
env:
CMAKE_GENERATOR: "Ninja Multi-Config"
- name: Build Release
run: |
# Portable commands only
cmake --build build --config Release --verbose
cmake --build build --config Release --target all_verify_interface_header_sets
cmake --install build --config Release --prefix /opt/beman.exemplar
ls -R /opt/beman.exemplar
cmake --install build --config Release --prefix /opt/beman.lazy
ls -R /opt/beman.lazy
- name: Build Debug
run: |
# Portable commands only
cmake --build build --config Debug --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
ls -R /opt/beman.exemplar
cmake --install build --config Debug --prefix /opt/beman.lazy
ls -R /opt/beman.lazy

compiler-test:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compilers:
- class: GNU
version: 14
- class: GNU
version: 13
- class: GNU
version: 12
- class: LLVM
version: 20
- class: LLVM
version: 19
- class: LLVM
version: 18
- class: LLVM
version: 17
name: "Compiler: ${{ matrix.compilers.class }} ${{ matrix.compilers.version }}"
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -240,8 +237,8 @@ jobs:
run: |
cmake --build build --config Debug --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
cmake --install build --config Debug --prefix /opt/beman.lazy
find /opt/beman.lazy -type f
- name: Test Debug
run: ctest --test-dir build --build-config Debug

Expand Down
37 changes: 15 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,45 @@
cmake_minimum_required(VERSION 3.25)

project(
beman.exemplar # CMake Project Name, which is also the name of the top-level
beman.lazy # CMake Project Name, which is also the name of the top-level
# targets (e.g., library, executable, etc.).
DESCRIPTION "A Beman library exemplar"
DESCRIPTION "A Beman library lazy (coroutine task)"
LANGUAGES CXX
)

enable_testing()

# [CMAKE.SKIP_TESTS]
option(
BEMAN_EXEMPLAR_BUILD_TESTS
BEMAN_LAZY_BUILD_TESTS
"Enable building tests and test infrastructure. Default: ON. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)

# [CMAKE.SKIP_EXAMPLES]
option(
BEMAN_EXEMPLAR_BUILD_EXAMPLES
BEMAN_LAZY_BUILD_EXAMPLES
"Enable building examples. Default: ON. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)

include(FetchContent)
include(GNUInstallDirs)

if(BEMAN_EXEMPLAR_BUILD_TESTS)
# Fetch GoogleTest
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG
f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
EXCLUDE_FROM_ALL
)
block()
set(INSTALL_GTEST OFF) # Disable GoogleTest installation
FetchContent_MakeAvailable(googletest)
endblock()
endif()
FetchContent_Declare(
execution26
# for local development, use SOURCE_DIR <path-to>/execution26
GIT_REPOSITORY https://github.com/bemanproject/execution26
GIT_TAG b52f28c
)
FetchContent_MakeAvailable(execution26)

add_subdirectory(src/beman/exemplar)
add_subdirectory(src/beman/lazy)

if(BEMAN_EXEMPLAR_BUILD_TESTS)
add_subdirectory(tests/beman/exemplar)
if(BEMAN_LAZY_BUILD_TESTS)
add_subdirectory(tests/beman/lazy)
endif()

if(BEMAN_EXEMPLAR_BUILD_EXAMPLES)
if(BEMAN_LAZY_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: config test default compile clean

BUILDDIR = build

default: test

compile: config
cmake --build $(BUILDDIR)

format:
git clang-format main

config:
cmake -DCMAKE_BUILD_TYPE=Debug -B $(BUILDDIR)

test: compile
cd $(BUILDDIR); ctest

clean:
$(RM) -r $(BUILDDIR) mkerr olderr
Loading
Loading