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
8 changes: 4 additions & 4 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup build environment
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0"
cmakeVersion: "~3.28.0"
ninjaVersion: "^1.11.1"
- name: Setup MSVC
if: startsWith(matrix.presets.platform, 'windows')
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Install Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0"
cmakeVersion: "~3.28.0"
ninjaVersion: "^1.11.1"
- name: Setup MSVC
if: startsWith(matrix.platform.os, 'windows')
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- name: Setup build environment
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0"
cmakeVersion: "~3.28.0"
ninjaVersion: "^1.11.1"
- name: Build and Test
uses: ./.github/actions/cmake-build-test
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
- name: Setup build environment
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0"
cmakeVersion: "~3.28.0"
ninjaVersion: "^1.11.1"
- name: Install Compiler
id: install-compiler
Expand Down
32 changes: 12 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,31 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on

cmake_minimum_required(VERSION 3.25...3.31)
cmake_minimum_required(VERSION 3.28...4.0)

project(
beman.execution
DESCRIPTION "Beman implementation of asynchronous components"
LANGUAGES CXX
VERSION 0.0.1
)
project(beman.execution DESCRIPTION "Beman implementation of asynchronous components" LANGUAGES CXX VERSION 0.0.2)

option(
BEMAN_EXECUTION_BUILD_TESTS
"Enable building tests and test infrastructure. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
option(BEMAN_EXECUTION_BUILD_TESTS
"Enable building tests and test infrastructure. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)
option(
BEMAN_EXECUTION_BUILD_EXAMPLES
"Enable building examples. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
option(BEMAN_EXECUTION_BUILD_EXAMPLES
"Enable building examples. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }." ${PROJECT_IS_TOP_LEVEL}
)
option(
BEMAN_EXECUTION_INSTALL_CONFIG_FILE_PACKAGE
"Enable creating and installing a CMake config-file package. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
BEMAN_EXECUTION_INSTALL_CONFIG_FILE_PACKAGE
"Enable creating and installing a CMake config-file package. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)

add_subdirectory(src/beman/execution)

enable_testing()

if(BEMAN_EXECUTION_BUILD_TESTS)
enable_testing()
add_subdirectory(tests/beman/execution)
endif()

if(BEMAN_EXECUTION_BUILD_EXAMPLES)
enable_testing()
add_subdirectory(examples)
endif()
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ doc:
# $(MAKE) SANITIZER=$@

build:
CC=$(CXX) cmake --fresh -G Ninja -S $(SOURCEDIR) -B $(BUILD) $(TOOLCHAIN) $(SYSROOT) \
CC=$(CXX) cmake --fresh -G Ninja -S $(SOURCEDIR) -B $(BUILD) $(TOOLCHAIN) $(SYSROOT) \
-D CMAKE_EXPORT_COMPILE_COMMANDS=1 \
-D CMAKE_CXX_COMPILER=$(CXX) # XXX -D CMAKE_CXX_FLAGS="$(CXX_FLAGS) $(SAN_FLAGS)"
-D CMAKE_CXX_COMPILER=$(CXX) -D CMAKE_CXX_STANDARD=23 # XXX -D CMAKE_CXX_FLAGS="$(CXX_FLAGS) $(SAN_FLAGS)"
cmake --build $(BUILD)

test: build
Expand All @@ -92,10 +92,10 @@ install: test
cmake --install $(BUILD) --prefix $(INSTALL_PREFIX)

release:
cmake --workflow --preset $@ --fresh
cmake --workflow --preset $(WORKFLOW)$@ --fresh

debug:
cmake --workflow --preset $@ --fresh
cmake --workflow --preset $(WORKFLOW)$@ --fresh

ce:
@mkdir -p $(BUILD)
Expand All @@ -118,12 +118,12 @@ clang-tidy: $(BUILD)/compile_commands.json
run-clang-tidy -p $(BUILD) tests examples

codespell:
codespell -L statics,snd,copyable,cancelled
codespell -w

format: cmake-format clang-format

cmake-format:
cmake-format -i `git diff --name-only main | egrep '(CMakeLists.txt|\.cmake)'`
git ls-files ::*.cmake ::*.cmake.in ::*CMakeLists.txt | xargs cmake-format -i

clang-format:
git clang-format main
Expand Down
10 changes: 4 additions & 6 deletions cmake/appleclang-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@

include_guard(GLOBAL)

set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
Comment on lines +19 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apple ships with an executable named g++ which is really clang++. I'm not objecting to this change although I wonder what that implication! I could imagine that the name does imply different defaults, e.g., using libc++ for clang++ and libstdc++ for g++.


if(BEMAN_BUILDSYS_SANITIZER STREQUAL "MaxSan")
set(SANITIZER_FLAGS
"-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined"
)
set(SANITIZER_FLAGS "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined")
elseif(BEMAN_BUILDSYS_SANITIZER STREQUAL "TSan")
set(SANITIZER_FLAGS "-fsanitize=thread")
set(SANITIZER_FLAGS "-fsanitize=thread")
endif()

set(CMAKE_C_FLAGS_DEBUG_INIT "${SANITIZER_FLAGS}")
Expand Down
8 changes: 4 additions & 4 deletions cmake/gnu-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)

if(BEMAN_BUILDSYS_SANITIZER STREQUAL "MaxSan")
set(SANITIZER_FLAGS
"-fsanitize=address -fsanitize=leak -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fsanitize-undefined-trap-on-error"
)
set(SANITIZER_FLAGS
"-fsanitize=address -fsanitize=leak -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fsanitize-undefined-trap-on-error"
)
elseif(BEMAN_BUILDSYS_SANITIZER STREQUAL "TSan")
set(SANITIZER_FLAGS "-fsanitize=thread")
set(SANITIZER_FLAGS "-fsanitize=thread")
endif()

set(CMAKE_C_FLAGS_DEBUG_INIT "${SANITIZER_FLAGS}")
Expand Down
8 changes: 4 additions & 4 deletions cmake/llvm-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)

if(BEMAN_BUILDSYS_SANITIZER STREQUAL "MaxSan")
set(SANITIZER_FLAGS
"-fsanitize=address -fsanitize=leak -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fsanitize-undefined-trap-on-error"
)
set(SANITIZER_FLAGS
"-fsanitize=address -fsanitize=leak -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fsanitize-undefined-trap-on-error"
)
elseif(BEMAN_BUILDSYS_SANITIZER STREQUAL "TSan")
set(SANITIZER_FLAGS "-fsanitize=thread")
set(SANITIZER_FLAGS "-fsanitize=thread")
endif()

set(CMAKE_C_FLAGS_DEBUG_INIT "${SANITIZER_FLAGS}")
Expand Down
6 changes: 3 additions & 3 deletions cmake/msvc-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)

if(BEMAN_BUILDSYS_SANITIZER STREQUAL "MaxSan")
# /Zi flag (add debug symbol) is needed when using address sanitizer
# See C5072: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-c5072
set(SANITIZER_FLAGS "/fsanitize=address /Zi")
# /Zi flag (add debug symbol) is needed when using address sanitizer
# See C5072: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-c5072
set(SANITIZER_FLAGS "/fsanitize=address /Zi")
endif()

set(CMAKE_CXX_FLAGS_DEBUG_INIT "/EHsc /permissive- ${SANITIZER_FLAGS}")
Expand Down
Loading