Skip to content
Draft
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
40 changes: 26 additions & 14 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ on:

jobs:
beman-submodule-check:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.1.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.2.1

preset-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.1.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.2.1
with:
matrix_config: >
[
{"preset": "gcc-debug", "image": "ghcr.io/bemanproject/infra-containers-gcc:latest"},
{"preset": "gcc-release", "image": "ghcr.io/bemanproject/infra-containers-gcc:latest"},
{"preset": "llvm-debug", "image": "ghcr.io/bemanproject/infra-containers-clang:latest"},
{"preset": "llvm-release", "image": "ghcr.io/bemanproject/infra-containers-clang:latest"},
{"preset": "appleclang-debug", "runner": "macos-latest"},
{"preset": "appleclang-release", "runner": "macos-latest"},
{"preset": "msvc-debug", "runner": "windows-latest"},
{"preset": "msvc-release", "runner": "windows-latest"}
]

build-and-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.1.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.2.1
with:
matrix_config: >
{
Expand All @@ -40,7 +42,8 @@ jobs:
"tests": [
{ "stdlibs": ["libstdc++"],
"tests": [
"Debug.Default", "Release.Default", "Release.MaxSan",
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror",
"Debug.Dynamic", "Debug.Coverage"
]
}
Expand All @@ -51,7 +54,7 @@ jobs:
}
]
},
{ "versions": ["14", "13"],
{ "versions": ["14"],
"tests": [
{ "cxxversions": ["c++26", "c++23"],
"tests": [{ "stdlibs": ["libstdc++"], "tests": ["Release.Default"]}]
Expand All @@ -60,42 +63,51 @@ jobs:
}
],
"clang": [
{ "versions": ["20"],
{ "versions": ["21"],
"tests": [
{"cxxversions": ["c++26"],
"tests": [
{ "stdlibs": ["libstdc++", "libc++"],
{ "stdlibs": ["libc++"],
"tests": [
"Debug.Default", "Release.Default", "Release.MaxSan",
"Debug.Dynamic"
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror"
]
}
]
},
{ "cxxversions": ["c++23"],
"tests": [
{"stdlibs": ["libstdc++", "libc++"], "tests": ["Release.Default"]}
{"stdlibs": ["libc++"], "tests": ["Release.Default"]}
]
}
]
},
{ "versions": ["19"],
{ "versions": ["20", "19"],
"tests": [
{ "cxxversions": ["c++26", "c++23"],
"tests": [
{"stdlibs": ["libstdc++", "libc++"], "tests": ["Release.Default"]}
{"stdlibs": ["libc++"], "tests": ["Release.Default"]}
]
}
]
}
],
"appleclang": [
{ "versions": ["latest"],
"tests": [
{ "cxxversions": ["c++23"],
"tests": [{ "stdlibs": ["libc++"], "tests": ["Release.Default"]}]
}
]
}
],
"msvc": [
{ "versions": ["latest"],
"tests": [
{ "cxxversions": ["c++23"],
"tests": [
{ "stdlibs": ["stl"],
"tests": ["Debug.Default", "Release.Default"]
"tests": ["Debug.Default", "Release.Default", "Release.MaxSan"]
}
]
}
Expand All @@ -107,4 +119,4 @@ jobs:
create-issue-when-fault:
needs: [preset-test, build-and-test]
if: failure() && github.event_name == 'schedule'
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.1.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.2.1
13 changes: 13 additions & 0 deletions .github/workflows/pre-commit-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Lint Check (pre-commit)

on:
# We have to use pull_request_target here as pull_request does not grant
# enough permission for reviewdog
pull_request_target:
push:
branches:
- main

jobs:
pre-commit:
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
15 changes: 15 additions & 0 deletions .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

name: Weekly pre-commit autoupdate

on:
workflow_dispatch:
schedule:
- cron: "0 16 * * 0"

jobs:
auto-update-pre-commit:
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
secrets:
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}
PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ repos:
# See also: https://github.com/ssciwr/clang-format-wheel
# Config file: .clang-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.7
rev: v21.1.8
hooks:
- id: clang-format
types_or: [c++, c, json]
exclude: docs/TODO.json

# CMake linting and formatting
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.23.2
rev: 0.25.3
hooks:
- id: gersemi
name: CMake linting
Expand All @@ -55,7 +55,7 @@ repos:
# Config file: pyproject.toml
# second Python code formatting
- repo: https://github.com/psf/black
rev: 25.11.0
rev: 26.1.0
hooks:
- id: black

Expand Down
79 changes: 21 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,36 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# gersemi: on

cmake_minimum_required(VERSION 3.25...4.2)

#========================== pre project settings ===============================
# gersemi: off
if(CMAKE_VERSION VERSION_EQUAL 4.2)
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")

if(CMAKE_CXX_STDLIB_MODULES_JSON)
message(
STATUS
"CMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON}"
)
endif()
endif()
# gersemi: on
#===============================================================================
cmake_minimum_required(VERSION 3.30...4.2)

include(cmake/prelude.cmake)
#===================================================
project(beman_execution VERSION 0.0.1 LANGUAGES CXX)
project(beman.execution VERSION 0.0.1 LANGUAGES CXX)
#===================================================

if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds are not allowed!")
endif()
# Modules opt in only on compilers that support it: msvc, g++-15 and clang-20+
include(cxx-modules-rules)

# TODO(CK): check this if is confirm to beman standard!
set(TARGET_NAME execution)
set(TARGET_NAMESPACE beman)
set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME})
set(TARGET_LIBRARY ${PROJECT_NAME})
set(TARGET_LIBRARY ${TARGET_NAME})
set(TARGET_ALIAS ${TARGET_NAMESPACE}::${TARGET_NAME})
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-config-targets)

#========================== post project settings ==============================
# Tell CMake that we explicitly want `import std`.
# This will initialize the property on all targets declared after this to 1
message(STATUS "CMAKE_CXX_COMPILER_IMPORT_STD=${CMAKE_CXX_COMPILER_IMPORT_STD}")
if(${CMAKE_CXX_STANDARD} IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD)
set(CMAKE_CXX_MODULE_STD ON)
message(STATUS "CMAKE_CXX_MODULE_STD=${CMAKE_CXX_MODULE_STD}")
endif()
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)

if(CMAKE_CXX_SCAN_FOR_MODULES AND ${CMAKE_GENERATOR} STREQUAL Ninja)
set(BEMAN_USE_MODULES ON)
message(STATUS "BEMAN_USE_MODULES=${BEMAN_USE_MODULES}")
else()
message(WARNING "Missing support for CMAKE_CXX_SCAN_FOR_MODULES!")
endif()
add_library(${TARGET_LIBRARY} STATIC)
add_library(${TARGET_ALIAS} ALIAS ${TARGET_LIBRARY})

# gersemi: off
if(CMAKE_EXPORT_COMPILE_COMMANDS)
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
message(
STATUS
"CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}"
if(BEMAN_HAS_MODULES)
# CMake requires the language standard to be specified as compile feature
# when a target provides C++23 modules and the target will be installed
target_compile_features(
${TARGET_LIBRARY}
PUBLIC cxx_std_${CMAKE_CXX_STANDARD}
)
endif()
# gersemi: on

# CMake requires the language standard to be specified as compile feature
# when a target provides C++23 modules and the target will be installed
add_library(${TARGET_NAME} STATIC)
target_compile_features(${TARGET_NAME} PUBLIC cxx_std_23)

if(BEMAN_USE_MODULES AND CMAKE_CXX_MODULE_STD)
target_compile_definitions(${TARGET_NAME} PUBLIC BEMAN_HAS_IMPORT_STD)
else()
message(WARNING "Missing support for CMAKE_CXX_MODULE_STD!")
endif()
#===============================================================================

option(
BEMAN_EXECUTION_ENABLE_TESTING
Expand All @@ -97,9 +57,9 @@ set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

add_subdirectory(src/beman/execution)

if(BEMAN_EXECUTION_ENABLE_TESTING)
enable_testing()
enable_testing()

if(BEMAN_EXECUTION_ENABLE_TESTING)
add_subdirectory(tests/beman/execution)
endif()

Expand All @@ -112,6 +72,9 @@ if(NOT BEMAN_EXECUTION_ENABLE_INSTALL OR CMAKE_SKIP_INSTALL_RULES)
return()
endif()

include(beman-install-library-config)
# FIXME(CK): beman_install_library(beman.execution)

include(CMakePackageConfigHelpers)

write_basic_package_version_file(
Expand Down
6 changes: 3 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 6,
"version": 9,
"configurePresets": [
{
"name": "_root-config",
Expand Down Expand Up @@ -61,7 +61,7 @@
"_debug-base"
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/llvm-toolchain.cmake"
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/llvm-libc++-toolchain.cmake"
}
},
{
Expand All @@ -72,7 +72,7 @@
"_release-base"
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/llvm-toolchain.cmake"
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/llvm-libc++-toolchain.cmake"
}
},
{
Expand Down
Loading
Loading