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
115 changes: 0 additions & 115 deletions .github/workflows/ci.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Linux

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
linux:
name: ${{ matrix.compiler }} ${{ matrix.build_type }}
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
include:
- build_type: Debug
runs_on: ubuntu-26.04
compiler: gcc-15
cc: gcc-15
cxx: g++-15
configure_preset: "linux"
build_preset: "linux-build"
test_preset: "linux-test"
- build_type: Debug
runs_on: ubuntu-26.04
compiler: clang-22
cc: clang-22
cxx: clang++-22
configure_preset: "linux"
build_preset: "linux-build"
test_preset: "linux-test"

steps:
- uses: actions/checkout@v6

- name: "Build & Test"
uses: lukka/run-cmake@v10
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
with:
configurePreset: ${{ matrix.configure_preset }}
configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}']"
buildPreset: ${{ matrix.build_preset }}
testPreset: ${{ matrix.test_preset }}
38 changes: 38 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: macOS

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
macos:
runs-on: macos-26
strategy:
fail-fast: false
matrix:
build_type: [Debug]
llvm_version: [20]
preset:
- configure_preset: "macos"
build_preset: "macos-build"
test_preset: "macos-test"

steps:
- uses: actions/checkout@v6

- name: Locate Homebrew LLVM
id: llvm
run: |
llvm_prefix="$(brew --prefix llvm@${{ matrix.llvm_version }})"
"$llvm_prefix/bin/clang++" --version
echo "cxx=$llvm_prefix/bin/clang++" >> "$GITHUB_OUTPUT"

- name: "Build & Test"
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.preset.configure_preset }}
configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}', '-DCMAKE_CXX_COMPILER=${{ steps.llvm.outputs.cxx }}']"
buildPreset: ${{ matrix.preset.build_preset }}
testPreset: ${{ matrix.preset.test_preset }}
28 changes: 28 additions & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: MSVC

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
msvc:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
preset:
- configure_preset: "x64"
build_preset: "x64-build"
test_preset: "x64-test"

steps:
- uses: actions/checkout@v6

- name: "Build & Test"
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.preset.configure_preset }}
buildPreset: ${{ matrix.preset.build_preset }}
testPreset: ${{ matrix.preset.test_preset }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ $RECYCLE.BIN/
ehthumbs.db
Thumbs.db
*.json
!CMakePresets.json
/vc140.pdb
19 changes: 14 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 4.2)

set(CACHE{CMAKE_EXPERIMENTAL_CXX_IMPORT_STD} TYPE STRING VALUE 451f2fe2-a8a2-47c3-bc32-94786d8fc91b)

include(cmake/prelude.cmake)

Expand All @@ -8,12 +10,16 @@ project(
LANGUAGES CXX
)

if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
set(CMAKE_CXX_MODULE_STD 1)
endif()

include(cmake/project-is-top-level.cmake)
include(cmake/variables.cmake)

option(BENCHER_ENABLE_JSON "Enable JSON output support via Glaze" OFF)

add_library(${PROJECT_NAME}_${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}_${PROJECT_NAME} STATIC)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}_${PROJECT_NAME} )

if (MSVC)
Expand All @@ -29,12 +35,14 @@ endif()

set_property(TARGET ${PROJECT_NAME}_${PROJECT_NAME} PROPERTY EXPORT_NAME ${PROJECT_NAME})

target_compile_features(${PROJECT_NAME}_${PROJECT_NAME} INTERFACE cxx_std_23)
target_compile_features(${PROJECT_NAME}_${PROJECT_NAME} PUBLIC cxx_std_23)
target_include_directories(
${PROJECT_NAME}_${PROJECT_NAME} ${warning_guard}
INTERFACE "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/modules>"
)

include(cmake/modules-files.cmake)

if(BENCHER_ENABLE_JSON)
include(FetchContent)
FetchContent_Declare(
Expand All @@ -45,6 +53,7 @@ if(BENCHER_ENABLE_JSON)
)
FetchContent_MakeAvailable(glaze)
target_link_libraries(${PROJECT_NAME}_${PROJECT_NAME} INTERFACE glaze::glaze)
target_compile_definitions(BENCHER_ENABLE_JSON)
endif()

if(NOT CMAKE_SKIP_INSTALL_RULES)
Expand All @@ -53,4 +62,4 @@ endif()

if (PROJECT_IS_TOP_LEVEL)
include(cmake/dev-mode.cmake)
endif()
endif()
82 changes: 82 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"version": 9,
"configurePresets": [
{
"name": "windows-base-vs",
"hidden": true,
"generator": "Visual Studio 18 2026",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64",
"inherits": "windows-base-vs",
"cacheVariables": {
"BUILD_TESTING": "ON"
}
},
{
"name": "linux",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"cacheVariables": {
"BUILD_TESTING": "ON"
}
},
{
"name": "macos",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
},
"cacheVariables": {
"BUILD_TESTING": "ON"
}
}
],
"buildPresets": [
{
"name": "x64-build",
"configurePreset": "x64",
"configuration": "Debug"
},
{
"name": "linux-build",
"configurePreset": "linux"
},
{
"name": "macos-build",
"configurePreset": "macos"
}
],
"testPresets": [
{
"name": "x64-test",
"configurePreset": "x64",
"configuration": "Debug"
},
{
"name": "linux-test",
"configurePreset": "linux"
},
{
"name": "macos-test",
"configurePreset": "macos"
}
]
}
4 changes: 3 additions & 1 deletion cmake/install-config.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
include("${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake")
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
Loading