Skip to content
Open
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
56 changes: 39 additions & 17 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ on:
pull_request:
workflow_dispatch:
schedule:
- cron: '30 15 * * *'
- cron: '30 15 * * 6'

concurrency:
group: ${{format('{0}:{1}', github.repository, github.ref)}}
cancel-in-progress: true

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

preset-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.7.3
with:
matrix_config: >
[
Expand All @@ -29,33 +33,45 @@ jobs:
]

build-and-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.7.3
with:
matrix_config: >
{
"gcc": [
{ "versions": ["15"],
{ "versions": ["16"],
"tests": [
{ "cxxversions": ["c++26"],
"tests": [
{ "stdlibs": ["libstdc++"],
"tests": [
"Debug.Default", "Release.Default", "Release.MaxSan",
"Debug.Coverage", "Debug.Werror",
"Debug.Dynamic", "Release.Dynamic"
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror",
"Debug.Coverage", "Debug.-DBEMAN_USE_MODULES=On"
]
}
]
},
{ "cxxversions": ["c++23"],
"tests": [{ "stdlibs": ["libstdc++"], "tests": ["Release.Default"]}]
"tests": [
{ "stdlibs": ["libstdc++"],
"tests": [
"Release.Default", "Debug.-DBEMAN_USE_MODULES=On"
]
}
]
}
]
},
{ "versions": ["14"],
{ "versions": ["15"],
"tests": [
{ "cxxversions": ["c++26", "c++23"],
"tests": [{ "stdlibs": ["libstdc++"], "tests": ["Release.Default"]}]
"tests": [
{ "stdlibs": ["libstdc++"],
"tests": [
"Release.Default", "Debug.-DBEMAN_USE_MODULES=On"
]
}
]
}
]
}
Expand All @@ -67,15 +83,20 @@ jobs:
"tests": [
{ "stdlibs": ["libc++"],
"tests": [
"Debug.Default", "Release.Default", "Release.MaxSan",
"Debug.Dynamic", "Release.Dynamic"
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror",
"Debug.-DBEMAN_USE_MODULES=On"
]
}
]
},
{ "cxxversions": ["c++23"],
"tests": [
{"stdlibs": ["libc++"], "tests": ["Release.Default"]}
{ "stdlibs": ["libc++"],
"tests": [
"Release.Default", "Debug.-DBEMAN_USE_MODULES=On"
]
}
]
}
]
Expand All @@ -96,8 +117,9 @@ jobs:
{ "cxxversions": ["c++23"],
"tests": [
{ "stdlibs": ["stl"],
"tests": ["Debug.Default", "Release.Default", "Release.MaxSan",
"Debug.Dynamic", "Release.Dynamic"
"tests": [
"Debug.Default", "Release.Default", "Release.MaxSan",
"Debug.-DBEMAN_USE_MODULES=On"
]
}
]
Expand All @@ -110,4 +132,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.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.7.3
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
auto-update-pre-commit:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.7.3
secrets:
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}
PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ cmake-build-*
.cache
.vscode
.idea
.init
compile_commands.json
stagedir

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:

# Config file: .codespellrc
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
rev: v2.4.3
hooks:
- id: codespell
files: ^.*\.(cmake|cpp|cppm|hpp|txt|md|mds|json|js|in|yaml|yml|py|toml)$
Expand Down Expand Up @@ -49,7 +49,7 @@ repos:
# Config file: pyproject.toml
# first Python sort imports
- repo: https://github.com/pycqa/isort
rev: 9.0.0a3
rev: 9.0.0b1
hooks:
- id: isort

Expand Down
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ set(BEMAN_EXECUTION_TARGET_PREFIX ${PROJECT_NAME}) # NOTE: used in src, and docs

#===============================================================================
if(BEMAN_USE_MODULES)
option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)

set(CMAKE_CXX_SCAN_FOR_MODULES ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
Expand Down Expand Up @@ -61,14 +59,6 @@ if(BEMAN_USE_MODULES)
DLL_NAME_WITH_SOVERSION TRUE
)

# FIXME: Quickfix only to prevent linker problems on windows dll? CK
if(WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(
${BEMAN_EXECUTION_TARGET_PREFIX}
PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON
)
endif()

find_package(Threads REQUIRED)
target_link_libraries(
${BEMAN_EXECUTION_TARGET_PREFIX}
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"_release-base"
],
"cacheVariables": {
"BEMAN_USE_STD_MODULE": false,
"BEMAN_USE_STD_MODULE": true,
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/llvm-libc++-toolchain.cmake"
},
"environment": {
Expand Down
63 changes: 63 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# GNUmakefile
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

MAKEFLAGS+= --no-builtin-rules # Disable the built-in implicit rules.
MAKEFLAGS+= --no-builtin-variables # Disable the built-in variable settings.
MAKEFLAGS+= --warn-undefined-variables # Warn when an undefined variable is referenced.
.SUFFIXES: # Disable all suffix rules.
##################################################

PRESET ?= release
IMAGE ?= linux-clang:23

_build_path:=build/$(PRESET)

.PHONY: all check distclean dockerbuild

# default target rule
all: .init compile_commands.json ## Make all with cmake workflow preset
cmake --workflow --preset $(PRESET)

.init: CMakeUserPresets.json CMakePresets.json CMakeLists.txt ## Configure cmake preset in VERBOSE mode
cmake --preset $(PRESET) --fresh --log-level=VERBOSE
touch $@

check: .init compile_commands.json ## Run clang-tidy on examples
run-clang-tidy examples

.PHONY: compile_commands.json
compile_commands.json: $(_build_path)/compile_commands.json
if [ "$(shell readlink compile_commands.json)" != "$(_build_path)/compile_commands.json" ] ; then \
ln -fs $< $@
fi

CMakeUserPresets.json:: cmake/CMakeUserPresets.json
ln -fs $< $@

distclean: ## Remove all build artifacts
rm -rf build .cache
rm -f CMakeUserPresets.json \
compile_commands.json \
.init
find . -name '*~' -delete

dockerbuild: ## Start docker image interactive
docker run -it -v $(CURDIR):/home/builder/workdir $(IMAGE)

# Helper targets
.PHONY: env info

env: ## Show env
$(foreach v, $(.VARIABLES), $(info $(v) = $($(v))))

info: ## Show this help.
@awk 'BEGIN {FS = ":.*?## "} /^[.a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort

# NOTE: double-colon targets which has no prerequisites must always remade by gmake?
# Prerequisite 'GNUmakefile' is newer than target '.init'.
# -> Must remake target '.init'.
# NOTE: impizit handled by gmake! GNUmakefile :: ;

# Anything we don't know how to build will use this rule.
% ::
ninja -C $(_build_path) $(@)
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ifeq (${hostSystemName},Darwin)
# export LDFLAGS=-L$(LLVM_DIR)/lib/c++ -lc++abi -lc++ # -lc++experimental
# export GCOV="llvm-cov gcov"

### TODO: to test g++-15:
### TODO: to test g++-16:
# export GCC_PREFIX:=$(shell brew --prefix gcc)
# export GCC_DIR:=$(shell realpath ${GCC_PREFIX})

Expand All @@ -63,16 +63,16 @@ ifeq (${hostSystemName},Darwin)
export CXX=clang++
CXXLIB=libc++
else
export CXX=g++-15
export CXX=g++-16
CXXLIB=libstdc++
endif
export CXX_FLAGS=-stdlib=$(CXXLIB)
endif
export GCOV="gcov"
else ifeq (${hostSystemName},Linux)
export LLVM_DIR=/usr/lib/llvm-20
export LLVM_DIR=/usr/lib/llvm-23
export PATH:=${LLVM_DIR}/bin:${PATH}
# export CXX=clang++-20
# NO! export CXX=clang++-23
else
export CXX=$(COMPILER)
endif
Expand Down
Loading
Loading