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
2 changes: 1 addition & 1 deletion .beman-tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# https://github.com/bemanproject/beman-tidy/blob/main/README.md

disabled_rules:
- readme.title
# None
ignored_paths:
# None
1 change: 1 addition & 0 deletions .exemplar_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
29fd521a15439a3338272cb91c4940f63aa01cc5
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

* @ednolan @bretbrownjr @camio @dietmarkuehl @steve-downey @wusatosi
* @aryann,bartholomaios
29 changes: 0 additions & 29 deletions .github/workflows/catch2_exemplar_test.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:
workflow_dispatch:
schedule:
- cron: '30 15 * * 6'
- cron: '30 16 * * 2'

concurrency:
group: ${{format('{0}:{1}', github.repository, github.ref)}}
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
"tests": [
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror",
"Debug.Coverage", "Debug.-DBEMAN_EXEMPLAR_USE_MODULES=On"
"Debug.Coverage", "Debug.-DBEMAN_STR_SPLIT_USE_MODULES=On"
]
}
]
Expand All @@ -57,7 +57,7 @@ jobs:
"tests": [
{ "stdlibs": ["libstdc++"],
"tests": [
"Release.Default", "Debug.-DBEMAN_EXEMPLAR_USE_MODULES=On"
"Release.Default", "Debug.-DBEMAN_STR_SPLIT_USE_MODULES=On"
]
}
]
Expand All @@ -73,7 +73,7 @@ jobs:
"tests": [
{ "stdlibs": ["libstdc++"],
"tests": [
"Release.Default", "Debug.-DBEMAN_EXEMPLAR_USE_MODULES=On"
"Release.Default", "Debug.-DBEMAN_STR_SPLIT_USE_MODULES=On"
]
}
]
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
"tests": [
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror",
"Debug.-DBEMAN_EXEMPLAR_USE_MODULES=On"
"Debug.-DBEMAN_STR_SPLIT_USE_MODULES=On"
]
}
]
Expand All @@ -117,7 +117,7 @@ jobs:
"tests": [
{ "stdlibs": ["libstdc++", "libc++"],
"tests": [
"Release.Default", "Debug.-DBEMAN_EXEMPLAR_USE_MODULES=On"
"Release.Default", "Debug.-DBEMAN_STR_SPLIT_USE_MODULES=On"
]
}
]
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
{ "stdlibs": ["stl"],
"tests": [
"Debug.Default", "Release.Default", "Release.MaxSan",
"Debug.-DBEMAN_EXEMPLAR_USE_MODULES=On"
"Debug.-DBEMAN_STR_SPLIT_USE_MODULES=On"
]
}
]
Expand All @@ -189,7 +189,7 @@ jobs:
vcpkg-ci:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-ci.yml@1.7.2
with:
port_name: beman-exemplar
port_name: beman-str-split
feature_combinations: |
[
{"features": {}},
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/cookiecutter_test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Weekly pre-commit autoupdate
on:
workflow_dispatch:
schedule:
- cron: "0 16 * * 0"
- cron: "50 13 * * 0"

jobs:
auto-update-pre-commit:
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/todo_exemplar_test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/vcpkg-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
vcpkg-release:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-release.yml@1.7.2
with:
port_name: beman-exemplar
port_name: beman-str-split
secrets:
VCPKG_REGISTRY_TOKEN: ${{ secrets.VCPKG_REGISTRY_TOKEN }}
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ repos:
hooks:
- id: codespell

# Beman Standard checking via beman-tidy
- repo: https://github.com/bemanproject/beman-tidy
rev: v0.3.1
hooks:
- id: beman-tidy

exclude: 'cookiecutter/|infra/|port/'
48 changes: 24 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,86 +5,86 @@ cmake_minimum_required(VERSION 3.30...4.3)
include(infra/cmake/enable-experimental-import-std.cmake)

project(
beman.exemplar
DESCRIPTION "A Beman Library Exemplar"
beman.str_split
DESCRIPTION "Stand-alone, easy-to-use string split utilities"
LANGUAGES CXX
VERSION 2.4.0
VERSION 0.1.0
)

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

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

option(BEMAN_EXEMPLAR_USE_MODULES "Provide beman.exemplar as a C++ module" OFF)
option(BEMAN_STR_SPLIT_USE_MODULES "Provide beman.str_split as a C++ module" OFF)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pre-commit] reported by reviewdog 🐶

Suggested change
option(BEMAN_STR_SPLIT_USE_MODULES "Provide beman.str_split as a C++ module" OFF)
option(
BEMAN_STR_SPLIT_USE_MODULES
"Provide beman.str_split as a C++ module"
OFF
)


if(BEMAN_EXEMPLAR_USE_MODULES)
if(BEMAN_STR_SPLIT_USE_MODULES)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
endif()

configure_file(
"${PROJECT_SOURCE_DIR}/include/beman/exemplar/config_generated.hpp.in"
"${PROJECT_BINARY_DIR}/include/beman/exemplar/config_generated.hpp"
"${PROJECT_SOURCE_DIR}/include/beman/str_split/config_generated.hpp.in"
"${PROJECT_BINARY_DIR}/include/beman/str_split/config_generated.hpp"
@ONLY
)

# for find of beman_install_library and configure_build_telemetry
include(infra/cmake/beman-install-library.cmake)
include(infra/cmake/BuildTelemetryConfig.cmake)

if(BEMAN_EXEMPLAR_USE_MODULES)
add_library(beman.exemplar STATIC)
if(BEMAN_STR_SPLIT_USE_MODULES)
add_library(beman.str_split STATIC)
else()
add_library(beman.exemplar INTERFACE)
add_library(beman.str_split INTERFACE)
endif()
add_library(beman::exemplar ALIAS beman.exemplar)
add_library(beman::str_split ALIAS beman.str_split)

if(BEMAN_EXEMPLAR_USE_MODULES)
if(BEMAN_STR_SPLIT_USE_MODULES)
target_sources(
beman.exemplar
beman.str_split
PUBLIC
FILE_SET CXX_MODULES
FILE_SET HEADERS
BASE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include"
)
set_target_properties(beman.exemplar PROPERTIES CXX_MODULE_STD ON)
target_compile_features(beman.exemplar PUBLIC cxx_std_23)
set_target_properties(beman.str_split PROPERTIES CXX_MODULE_STD ON)
target_compile_features(beman.str_split PUBLIC cxx_std_23)
else()
target_sources(
beman.exemplar
beman.str_split
PUBLIC
FILE_SET HEADERS
BASE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include"
)
set_target_properties(
beman.exemplar
beman.str_split
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL}
)
endif()

add_subdirectory(include/beman/exemplar)
add_subdirectory(include/beman/str_split)

beman_install_library(beman.exemplar TARGETS beman.exemplar)
beman_install_library(beman.str_split TARGETS beman.str_split)
configure_build_telemetry()

if(BEMAN_EXEMPLAR_BUILD_TESTS)
if(BEMAN_STR_SPLIT_BUILD_TESTS)
enable_testing()
add_subdirectory(tests/beman/exemplar)
add_subdirectory(tests/beman/str_split)
endif()

if(BEMAN_EXEMPLAR_BUILD_EXAMPLES)
if(BEMAN_STR_SPLIT_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_CXX_STANDARD": "23",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "./infra/cmake/use-fetch-content.cmake"
}
Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ that this requires GoogleTest to be installed.
cmake \
-B build \
-S . \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=23 \
# Your extra arguments here.
cmake --build build
ctest --test-dir build
Expand Down Expand Up @@ -85,7 +85,7 @@ vcpkg.
### FetchContent

Instead of installing the project's dependencies via a package manager, you can optionally
configure beman.exemplar to fetch them automatically via CMake FetchContent.
configure beman.str_split to fetch them automatically via CMake FetchContent.

To do so, specify
`-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./infra/cmake/use-fetch-content.cmake`. This will
Expand All @@ -97,7 +97,7 @@ Example commands:
cmake \
-B build \
-S . \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=23 \
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./infra/cmake/use-fetch-content.cmake
cmake --build build
ctest --test-dir build
Expand All @@ -108,32 +108,32 @@ acquired by FetchContent.

## Project-specific configure arguments

Project-specific options are prefixed with `BEMAN_EXEMPLAR`.
Project-specific options are prefixed with `BEMAN_STR_SPLIT`.
You can see the list of available options with:

```bash
cmake -LH -S . -B build | grep "BEMAN_EXEMPLAR" -C 2
cmake -LH -S . -B build | grep "BEMAN_STR_SPLIT" -C 2
```

<details>

<summary>Some project-specific configure arguments</summary>

### `BEMAN_EXEMPLAR_BUILD_TESTS`
### `BEMAN_STR_SPLIT_BUILD_TESTS`

Enable building tests and test infrastructure. Default: `ON`.
Values: `{ ON, OFF }`.

### `BEMAN_EXEMPLAR_BUILD_EXAMPLES`
### `BEMAN_STR_SPLIT_BUILD_EXAMPLES`

Enable building examples. Default: `ON`. Values: `{ ON, OFF }`.

### `BEMAN_EXEMPLAR_INSTALL_CONFIG_FILE_PACKAGE`
### `BEMAN_STR_SPLIT_INSTALL_CONFIG_FILE_PACKAGE`

Enable installing the CMake config file package. Default: `ON`.
Values: `{ ON, OFF }`.

This is required so that users of `beman.exemplar` can use
`find_package(beman.exemplar)` to locate the library.
This is required so that users of `beman.str_split` can use
`find_package(beman.str_split)` to locate the library.

</details>
Loading
Loading