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
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ common --enable_platform_specific_config
# Default Build Options
build --features=external_include_paths

# Freestanding Configuration
build:freestanding --cxxopt=-ffreestanding --cxxopt=-fno-exceptions --cxxopt=-fno-rtti
build:freestanding --linkopt=-nodefaultlibs --linkopt=-lc

# Platform-Specific Toolchain Overrides
build:linux --repo_env=BAZEL_CXXOPTS=-std=c++20
build:macos --repo_env=BAZEL_CXXOPTS=-std=c++20
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/bvt-appleclang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,37 @@ jobs:
- name: Build and run test with AppleClang on cmake
run: |
cmake -B build-cmake -GNinja -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=FALSE
cmake --build build-cmake -j
ctest --test-dir build-cmake -j
mkdir build-cmake/drop
bash ./tools/dump_build_env.sh c++ build-cmake/drop/env-info.json
cmake --preset default -DCMAKE_CXX_STANDARD=23 -DPROXY_BUILD_MODULES=FALSE
cmake --build --preset default -j
ctest --preset default -j
mkdir build/cmake/drop
bash ./tools/dump_build_env.sh c++ build/cmake/drop/env-info.json
- name: Build and run freestanding test with AppleClang on cmake
run: |
cmake --preset freestanding -DCMAKE_CXX_STANDARD=23 -DPROXY_BUILD_MODULES=FALSE
cmake --build --preset freestanding -j
ctest --preset freestanding -j
- name: Build and run test with AppleClang on meson
run: |
meson setup build-meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build-meson
meson test -C build-meson --benchmark --test-args=--benchmark_list_tests=true
meson setup build/meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build/meson
meson test -C build/meson --benchmark --test-args=--benchmark_list_tests=true
- name: Build and run freestanding test with AppleClang on meson
run: |
meson setup build/meson-freestanding --buildtype=release -Dfreestanding=true
meson test -C build/meson-freestanding
- name: Build and Run test with AppleClang on bazel
run: bazel test --lockfile_mode=error //tests:proxy_tests //benchmarks:proxy_benchmarks //docs/...

- name: Run benchmarks
run: build-cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build-cmake/drop/benchmarking-results.json
run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json

- name: Archive benchmarking results
uses: actions/upload-artifact@v7
with:
name: drop-appleclang
path: build-cmake/drop/
path: build/cmake/drop/
36 changes: 25 additions & 11 deletions .github/workflows/bvt-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,40 @@ jobs:

- name: Build and run test with clang ${{ env.CLANG_VERSION }} on cmake
run: |
cmake -B build-cmake -GNinja -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=TRUE
cmake --build build-cmake -j
ctest --test-dir build-cmake -j
mkdir build-cmake/drop
bash ./tools/dump_build_env.sh "$CXX" build-cmake/drop/env-info.json
cmake --preset default -DCMAKE_CXX_STANDARD=23 -DPROXY_BUILD_MODULES=TRUE
cmake --build --preset default -j
ctest --preset default -j
mkdir build/cmake/drop
bash ./tools/dump_build_env.sh "$CXX" build/cmake/drop/env-info.json

- name: Build and run freestanding test with clang ${{ env.CLANG_VERSION }} on cmake
run: |
cmake --preset freestanding -DCMAKE_CXX_STANDARD=23 -DPROXY_BUILD_MODULES=TRUE
cmake --build --preset freestanding -j
ctest --preset freestanding -j

- name: Build and run test with clang ${{ env.CLANG_VERSION }} on meson
run: |
meson setup build-meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build-meson
meson test -C build-meson --benchmark --test-args=--benchmark_list_tests=true
meson setup build/meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build/meson
meson test -C build/meson --benchmark --test-args=--benchmark_list_tests=true

- name: Build and run freestanding test with clang ${{ env.CLANG_VERSION }} on meson
run: |
meson setup build/meson-freestanding --buildtype=release -Dfreestanding=true
meson test -C build/meson-freestanding

- name: Build and Run test with clang ${{ env.CLANG_VERSION }} on bazel
run: bazel test --lockfile_mode=error //tests:proxy_tests //tests:proxy_freestanding_tests //benchmarks:proxy_benchmarks //docs/...
run: bazel test --lockfile_mode=error //tests:proxy_tests //benchmarks:proxy_benchmarks //docs/...

- name: Build and run freestanding test with clang ${{ env.CLANG_VERSION }} on bazel
run: bazel test --config=freestanding --lockfile_mode=error //tests:proxy_freestanding_tests

- name: Run benchmarks
run: build-cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build-cmake/drop/benchmarking-results.json
run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json

- name: Archive benchmarking results
uses: actions/upload-artifact@v7
with:
name: drop-clang
path: build-cmake/drop/
path: build/cmake/drop/
14 changes: 10 additions & 4 deletions .github/workflows/bvt-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
compiler:
- {family: gcc, version: 13, modules: false, doc_tests: true}
- {family: gcc, version: 14, modules: true, doc_tests: true}
- {family: gcc, version: 14, modules: false, doc_tests: true}
- {family: clang, version: 16, modules: false, doc_tests: false}
- {family: clang, version: 17, modules: false, doc_tests: true}
- {family: clang, version: 18, modules: false, doc_tests: true}
Expand Down Expand Up @@ -53,6 +53,12 @@ jobs:
- name: Build and run test with cmake
run: |
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release '-DPROXY_BUILD_MODULES=${{ matrix.compiler.modules }}' '-DBUILD_DOC_TESTING=${{ matrix.compiler.doc_tests }}'
cmake --build build -j
ctest --test-dir build -j
cmake --preset default '-DPROXY_BUILD_MODULES=${{ matrix.compiler.modules }}' '-DBUILD_DOC_TESTING=${{ matrix.compiler.doc_tests }}'
cmake --build --preset default -j
ctest --preset default -j
- name: Build and run freestanding test with cmake
run: |
cmake --preset freestanding '-DPROXY_BUILD_MODULES=${{ matrix.compiler.modules }}' '-DBUILD_DOC_TESTING=${{ matrix.compiler.doc_tests }}'
cmake --build --preset freestanding -j
ctest --preset freestanding -j
36 changes: 25 additions & 11 deletions .github/workflows/bvt-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,41 @@ jobs:

- name: Build and run test with gcc 15 on cmake
run: |
cmake -B build-cmake -GNinja -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=TRUE
cmake --build build-cmake -j
ctest --test-dir build-cmake -j
mkdir build-cmake/drop
cmake --preset default -DCMAKE_CXX_STANDARD=23 -DPROXY_BUILD_MODULES=TRUE
cmake --build --preset default -j
ctest --preset default -j
mkdir build/cmake/drop
chmod +x tools/dump_build_env.sh
./tools/dump_build_env.sh g++ build-cmake/drop/env-info.json
./tools/dump_build_env.sh g++ build/cmake/drop/env-info.json

- name: Build and run freestanding test with gcc 15 on cmake
run: |
cmake --preset freestanding -DCMAKE_CXX_STANDARD=23 -DPROXY_BUILD_MODULES=TRUE
cmake --build --preset freestanding -j
ctest --preset freestanding -j

- name: Build and run test with gcc 15 on meson
run: |
meson setup build-meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build-meson
meson test -C build-meson --benchmark --test-args=--benchmark_list_tests=true
meson setup build/meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build/meson
meson test -C build/meson --benchmark --test-args=--benchmark_list_tests=true

- name: Build and run freestanding test with gcc 15 on meson
run: |
meson setup build/meson-freestanding --buildtype=release -Dfreestanding=true
meson test -C build/meson-freestanding

- name: Build and Run test with gcc 15 on bazel
run: bazel test --lockfile_mode=error //tests:proxy_tests //tests:proxy_freestanding_tests //benchmarks:proxy_benchmarks //docs/...
run: bazel test --lockfile_mode=error //tests:proxy_tests //benchmarks:proxy_benchmarks //docs/...

- name: Build and run freestanding test with gcc 15 on bazel
run: bazel test --config=freestanding --lockfile_mode=error //tests:proxy_freestanding_tests

- name: Run benchmarks
run: build-cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build-cmake/drop/benchmarking-results.json
run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json

- name: Archive benchmarking results
uses: actions/upload-artifact@v7
with:
name: drop-gcc
path: build-cmake/drop/
path: build/cmake/drop/
20 changes: 10 additions & 10 deletions .github/workflows/bvt-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ jobs:

- name: Build and run test with MSVC on cmake
run: |
cmake -B build-cmake -DCMAKE_CXX_STANDARD=23 -DPROXY_BUILD_MODULES=TRUE `
&& cmake --build build-cmake --config Release -j `
&& ctest --test-dir build-cmake -C Release -j `
&& mkdir build-cmake\drop > $null `
&& .\tools\dump_build_env_msvc.ps1 -OutputPath build-cmake\drop\env-info.json
cmake -B build/cmake -DCMAKE_CXX_STANDARD=23 -DPROXY_BUILD_MODULES=TRUE `
&& cmake --build build/cmake --config Release -j `
&& ctest --test-dir build/cmake -C Release -j `
&& mkdir build/cmake/drop > $null `
&& .\tools\dump_build_env_msvc.ps1 -OutputPath build/cmake/drop/env-info.json

- name: Build and run test with MSVC on meson
run: |
meson setup build-meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled --vsenv
meson test -C build-meson
meson test -C build-meson --benchmark --test-args=--benchmark_list_tests=true
meson setup build/meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled --vsenv
meson test -C build/meson
meson test -C build/meson --benchmark --test-args=--benchmark_list_tests=true

- name: Build and Run test with MSVC on bazel
run: bazel test --lockfile_mode=error //tests:proxy_tests //benchmarks:proxy_benchmarks //docs/...

- name: Run benchmarks
run: build-cmake\benchmarks\Release\msft_proxy_benchmarks.exe --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build-cmake\drop\benchmarking-results.json
run: build/cmake/benchmarks/Release/msft_proxy_benchmarks.exe --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json

- name: Archive benchmarking results
uses: actions/upload-artifact@v7
with:
name: drop-msvc
path: build-cmake/drop/
path: build/cmake/drop/
20 changes: 10 additions & 10 deletions .github/workflows/bvt-nvhpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ jobs:

- name: Build and run test with NVHPC ${{ env.NVHPC_VERSION }} on cmake
run: |
cmake -B build-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPROXY_BUILD_MODULES=FALSE
cmake --build build-cmake -j
ctest --test-dir build-cmake -j
mkdir build-cmake/drop
cmake --preset default -DPROXY_BUILD_MODULES=FALSE
cmake --build --preset default -j
ctest --preset default -j
mkdir build/cmake/drop
chmod +x tools/dump_build_env.sh
./tools/dump_build_env.sh "$CXX" build-cmake/drop/env-info.json
./tools/dump_build_env.sh "$CXX" build/cmake/drop/env-info.json

- name: Build and run test with NVHPC ${{ env.NVHPC_VERSION }} on meson
run: |
meson setup build-meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build-meson
meson test -C build-meson --benchmark --test-args=--benchmark_list_tests=true
meson setup build/meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build/meson
meson test -C build/meson --benchmark --test-args=--benchmark_list_tests=true

- name: Run benchmarks
run: build-cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build-cmake/drop/benchmarking-results.json
run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json

- name: Archive benchmarking results
uses: actions/upload-artifact@v7
with:
name: drop-nvhpc
path: build-cmake/drop/
path: build/cmake/drop/
36 changes: 25 additions & 11 deletions .github/workflows/bvt-oneapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,40 @@ jobs:

- name: Build and run test with oneapi on cmake
run: |
cmake -B build-cmake -GNinja -DCMAKE_CXX_STANDARD=23 -DCMAKE_BUILD_TYPE=Release
cmake --build build-cmake -j
ctest --test-dir build-cmake -j
mkdir build-cmake/drop
bash ./tools/dump_build_env.sh "$CXX" build-cmake/drop/env-info.json
cmake --preset default -DCMAKE_CXX_STANDARD=23
cmake --build --preset default -j
ctest --preset default -j
mkdir build/cmake/drop
bash ./tools/dump_build_env.sh "$CXX" build/cmake/drop/env-info.json

- name: Build and run freestanding test with oneapi on cmake
run: |
cmake --preset freestanding -DCMAKE_CXX_STANDARD=23
cmake --build --preset freestanding -j
ctest --preset freestanding -j

- name: Build and run test with oneapi on meson
run: |
meson setup build-meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build-meson
meson test -C build-meson --benchmark --test-args=--benchmark_list_tests=true
meson setup build/meson --buildtype=release -Dtests=enabled -Dbenchmarks=enabled
meson test -C build/meson
meson test -C build/meson --benchmark --test-args=--benchmark_list_tests=true

- name: Build and run freestanding test with oneapi on meson
run: |
meson setup build/meson-freestanding --buildtype=release -Dfreestanding=true
meson test -C build/meson-freestanding

- name: Build and Run test with oneapi on bazel
run: bazel test --lockfile_mode=error --cxxopt=-Wno-c++23-extensions --test_env=LD_LIBRARY_PATH //tests:proxy_tests //tests:proxy_freestanding_tests //benchmarks:proxy_benchmarks //docs/...
run: bazel test --lockfile_mode=error --cxxopt=-Wno-c++23-extensions --test_env=LD_LIBRARY_PATH //tests:proxy_tests //benchmarks:proxy_benchmarks //docs/...

- name: Build and run freestanding test with oneapi on bazel
run: bazel test --config=freestanding --lockfile_mode=error --cxxopt=-Wno-c++23-extensions --test_env=LD_LIBRARY_PATH //tests:proxy_freestanding_tests

- name: Run benchmarks
run: build-cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build-cmake/drop/benchmarking-results.json
run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json

- name: Archive benchmarking results
uses: actions/upload-artifact@v7
with:
name: drop-oneapi
path: build-cmake/drop/
path: build/cmake/drop/
58 changes: 36 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ if(PROJECT_IS_TOP_LEVEL)
"When this project is top level, build the docs and tests with C++ module support."
OFF
)
option(
PROXY_FREESTANDING
"When this project is top level, configure proxy and its tests for a freestanding environment. GCC/Clang only."
OFF
)
endif()

if(PROXY_FREESTANDING)
add_compile_options(-ffreestanding -fno-exceptions -fno-rtti)
add_link_options(-nodefaultlibs -lc)
endif()

file(GLOB_RECURSE proxy_public_headers CONFIGURE_DEPENDS
Expand Down Expand Up @@ -101,24 +111,6 @@ install(
if(BUILD_TESTING)
include(CTest)

include(cmake/read_dependencies.cmake)
proxy_read_dependencies("${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies.json")

include(FetchContent)
# The policy uses the download time for timestamp, instead of the timestamp in the archive. This
# allows for proper rebuilds when a projects URL changes.
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()

FetchContent_Declare(
fmt
URL ${PROXY_FMT_URL}
URL_HASH SHA256=${PROXY_FMT_SHA256}
SYSTEM
)
FetchContent_MakeAvailable(fmt)

if(MSVC)
set(PROXY_BUILD_FLAGS /utf-8 /W4)
set(PROXY_STRICT_WARNING_FLAGS ${PROXY_BUILD_FLAGS} /WX)
Expand All @@ -133,10 +125,32 @@ if(BUILD_TESTING)
set(PROXY_STRICT_WARNING_FLAGS ${PROXY_BUILD_FLAGS} -Werror)
endif()

add_subdirectory(tests)
add_subdirectory(benchmarks)
if(PROXY_FREESTANDING)
add_subdirectory(tests/freestanding)
else()
include(cmake/read_dependencies.cmake)
proxy_read_dependencies("${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies.json")

include(FetchContent)
# The policy uses the download time for timestamp, instead of the timestamp in the archive. This
# allows for proper rebuilds when a projects URL changes.
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()

FetchContent_Declare(
fmt
URL ${PROXY_FMT_URL}
URL_HASH SHA256=${PROXY_FMT_SHA256}
SYSTEM
)
FetchContent_MakeAvailable(fmt)

add_subdirectory(tests)
add_subdirectory(benchmarks)

if(BUILD_DOC_TESTING)
add_subdirectory(docs)
if(BUILD_DOC_TESTING)
add_subdirectory(docs)
endif()
endif()
endif()
Loading
Loading