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 .exemplar_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b1e7015b1bd62ce5b20009cec7ee98ba5c783818
a8a97fdec16bfd081aa1814402f13b6a20327046
13 changes: 9 additions & 4 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on:

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

preset-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.5.3
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.6.0
with:
matrix_config: >
[
Expand All @@ -31,7 +31,7 @@ jobs:
]

build-and-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.5.3
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.6.0
with:
matrix_config: >
{
Expand Down Expand Up @@ -123,7 +123,12 @@ jobs:
]
}

vcpkg-ci:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-ci.yml@1.6.0
with:
port_name: beman-transform-view

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.5.3
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.6.0
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ on:

jobs:
pre-commit:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.5.3
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.6.0
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.5.3
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.6.0
secrets:
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}
PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }}
13 changes: 13 additions & 0 deletions .github/workflows/vcpkg-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

name: vcpkg registry release
on:
release:
types: [published]
jobs:
vcpkg-release:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-release.yml@1.6.0
with:
port_name: beman-transform-view
secrets:
VCPKG_REGISTRY_TOKEN: ${{ secrets.VCPKG_REGISTRY_TOKEN }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ repos:
hooks:
- id: beman-tidy

exclude: 'cookiecutter/|infra/'
exclude: 'cookiecutter/|infra/|port/'
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,30 @@ ctest --test-dir build

## Dependency Management

### vcpkg

The best way to install the project's dependencies is to use the vcpkg workflow.

To do so, make sure vcpkg is installed and `VCPKG_ROOT` is defined in your environment,
then specify
`-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"`. Vcpkg will handle
the project's dependencies, including GoogleTest.

Example commands:

```
cmake \
-B build \
-S . \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build build
ctest --test-dir build
```

The file `./vcpkg.json` configures the list of dependencies that will be configured by
vcpkg.

### FetchContent

Instead of installing the project's dependencies via a package manager, you can optionally
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ For details on building beman.transform_view without using a CMake preset, refer

### Installation

#### Vcpkg

The preferred way to install transform_view is via vcpkg. To do so, after installing vcpkg
itself, you need to add support for the Beman project's [vcpkg
registry](https://github.com/bemanproject/vcpkg-registry) by configuring a
`vcpkg-configuration.json` file (which transform_view [provides](vcpkg-configuration.json)).

Then, simply run `vcpkg install beman-transform-view`.

#### Manual

To install beman.transform_view globally after building with the `gcc-release` preset, you can
run:

Expand Down
2 changes: 1 addition & 1 deletion infra/.beman_submodule
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[beman_submodule]
remote=https://github.com/bemanproject/infra.git
commit_hash=dfdb103b5fc9cccd3424c377130e318466f1dd89
commit_hash=3a49dffbffbfd1c405ce36091dfc68ad02dd6965
47 changes: 46 additions & 1 deletion infra/cmake/use-fetch-content.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,50 @@ function(BemanExemplar_provideDependency method package_name)
GIT_TAG "${BemanExemplar_tag}"
EXCLUDE_FROM_ALL
)
set(INSTALL_GTEST OFF) # Disable GoogleTest installation

# Apply per-dependency cmake_args from the lockfile
string(
JSON BemanExemplar_cmakeArgs
ERROR_VARIABLE BemanExemplar_cmakeArgsError
GET "${BemanExemplar_depObj}"
"cmake_args"
)
if(NOT BemanExemplar_cmakeArgsError)
string(
JSON BemanExemplar_numCmakeArgs
LENGTH "${BemanExemplar_cmakeArgs}"
)
if(BemanExemplar_numCmakeArgs GREATER 0)
math(
EXPR
BemanExemplar_maxArgIndex
"${BemanExemplar_numCmakeArgs} - 1"
)
foreach(
BemanExemplar_argIndex
RANGE "${BemanExemplar_maxArgIndex}"
)
string(
JSON BemanExemplar_argKey
MEMBER "${BemanExemplar_cmakeArgs}"
"${BemanExemplar_argIndex}"
)
string(
JSON BemanExemplar_argValue
GET "${BemanExemplar_cmakeArgs}"
"${BemanExemplar_argKey}"
)
message(
DEBUG
"Setting ${BemanExemplar_argKey}=${BemanExemplar_argValue} for ${BemanExemplar_name}"
)
set("${BemanExemplar_argKey}"
"${BemanExemplar_argValue}"
)
endforeach()
endif()
endif()

FetchContent_MakeAvailable("${BemanExemplar_name}")

# Catch2's CTest integration module isn't on CMAKE_MODULE_PATH
Expand All @@ -179,6 +222,8 @@ function(BemanExemplar_provideDependency method package_name)
endforeach()
endfunction()

set(BEMAN_USE_FETCH_CONTENT_ENABLED ON)

cmake_language(
SET_DEPENDENCY_PROVIDER BemanExemplar_provideDependency
SUPPORTED_METHODS FIND_PACKAGE
Expand Down
5 changes: 4 additions & 1 deletion lockfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"name": "googletest",
"package_name": "GTest",
"git_repository": "https://github.com/google/googletest.git",
"git_tag": "6910c9d9165801d8827d628cb72eb7ea9dd538c5"
"git_tag": "6910c9d9165801d8827d628cb72eb7ea9dd538c5",
"cmake_args": {
"INSTALL_GTEST": "OFF"
}
}
]
}
28 changes: 28 additions & 0 deletions port/portfile.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO bemanproject/transform_view
REF "v@VERSION@"
SHA512 @SHA512@
HEAD_REF main
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBEMAN_TRANSFORM_VIEW_BUILD_TESTS=OFF
-DBEMAN_TRANSFORM_VIEW_BUILD_EXAMPLES=OFF
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(
PACKAGE_NAME beman.transform_view
CONFIG_PATH lib/cmake/beman.transform_view
)

file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug"
"${CURRENT_PACKAGES_DIR}/lib"
)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
17 changes: 17 additions & 0 deletions port/vcpkg.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "beman-transform-view",
"version-semver": "@VERSION@",
"description": "A conditionally borrowed std::ranges::transform_view",
"homepage": "https://github.com/bemanproject/transform_view",
"license": "Apache-2.0 WITH LLVM-exception",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
5 changes: 4 additions & 1 deletion tests/beman/transform_view/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ target_link_libraries(
)

include(GoogleTest)
gtest_discover_tests(beman.transform_view.tests.transform_view)
gtest_discover_tests(
beman.transform_view.tests.transform_view
DISCOVERY_TIMEOUT 60
)
15 changes: 15 additions & 0 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"default-registry": {
"kind": "git",
"repository": "https://github.com/microsoft/vcpkg.git",
"baseline": "80f9bcfa455e875d9c1bf7a7c6692d7e1e481061"
},
"registries": [
{
"kind": "git",
"repository": "https://github.com/bemanproject/vcpkg-registry.git",
"baseline": "5195f94f2b550163917c1152180fc59bbd760556",
"packages": ["beman-*"]
}
]
}
10 changes: 10 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "beman-transform-view",
"version-semver": "0.1.0",
"dependencies": [
{
"name": "gtest",
"host": true
}
]
}
Loading