diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 00000000..dd6962b5 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,10 @@ + +common --enable_bzlmod +build --incompatible_use_platforms_repo_for_constraints +build --incompatible_enable_cc_toolchain_resolution +build --incompatible_strict_action_env +build --enable_runfiles +build --registry=https://raw.githubusercontent.com/bazelboost/registry/main +build --registry=https://bcr.bazel.build + +try-import %workspace%/user.bazelrc diff --git a/.github/workflows/bzlmod-archive.yml b/.github/workflows/bzlmod-archive.yml new file mode 100644 index 00000000..d1823b66 --- /dev/null +++ b/.github/workflows/bzlmod-archive.yml @@ -0,0 +1,12 @@ +name: Bzlmod Archive + +on: + release: + types: [published] + +jobs: + bzlmod-archive: + uses: bazelboost/registry/.github/workflows/bzlmod-archive.yml@main + secrets: inherit + permissions: + contents: write diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 83252307..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Continuous Integration - -on: - push: - branches: - - '*' - - '*/*' - - pull_request: - branches: - - develop - -jobs: - build: - name: ${{ matrix.name }} - - strategy: - fail-fast: false - matrix: - include: - - { name: "MSVC 14.3 - C++17-20", os: windows-2022, cxxstd: '17,20', cmake_args: -G "Visual Studio 17 2022" -A x64, } - - { name: "clang-cl 14.3 - C++14,20", os: windows-2022, cxxstd: '14,20', cmake_args: -G "Visual Studio 17 2022" -T ClangCL -A x64, } - - { name: "MSVC 14.2 - C++14-17", os: windows-2019, cxxstd: '14,17', cmake_args: -G "Visual Studio 16 2019" -A x64, } - - - { name: "GCC 12 - C++17-20", os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, cxxstd: '17,20', } - - { name: "GCC 11 - C++14,20", os: ubuntu-22.04, cc: gcc-11, cxx: g++-11, cxxstd: '14,20', } -# The GCC 10 this runner has is broken -# - { name: "GCC 10 - C++17-20", os: ubuntu-22.04, cc: gcc-10, cxx: g++-10, cxxstd: '17,20', } - - { name: "GCC 9 - C++17-20", os: ubuntu-22.04, cc: gcc-9, cxx: g++-9, cxxstd: '17,20', } - - { name: "GCC 8 - C++14-17", os: ubuntu-20.04, cc: gcc-8, cxx: g++-8, cxxstd: '14,17', install: g++-8, } - - { name: "GCC 7 - C++14", os: ubuntu-20.04, cc: gcc-7, cxx: g++-7, cxxstd: 14, install: g++-7, } - - - { name: "Clang 14 - C++17-20", os: ubuntu-22.04, cc: clang-14, cxx: clang++-14, cxxstd: '17,20', } - - { name: "Clang 13 - C++14,20", os: ubuntu-22.04, cc: clang-13, cxx: clang++-13, cxxstd: '14,20', } - - { name: "Clang 12 - C++17-20", os: ubuntu-22.04, cc: clang-12, cxx: clang++-12, cxxstd: '17,20', } - - { name: "Clang 11 - C++14-17", os: ubuntu-20.04, cc: clang-11, cxx: clang++-11, cxxstd: '14,17', install: clang-11, } - - - { name: "AppleClang 13", os: macos-12, cxxstd: 17 } - - runs-on: ${{ matrix.os }} - - steps: - - name: Outcome checkout - uses: actions/checkout@v3 - - - name: Install packages - if: startsWith(matrix.os, 'ubuntu') && matrix.install - run: sudo apt-get install -y ${{ matrix.install }} - - - name: Boost checkout - uses: ./.github/actions/boost_clone - with: - boost_dir: boost - branch: ${{ (github.ref_name == 'master' && 'master') || 'develop' }} - modules: config,exception,system,throw_exception,test - - - name: CMake Run (C++${{ matrix.cxxstd }}) - uses: ./.github/actions/cmake_run - with: - cxxstd: ${{ matrix.cxxstd }} - cxx: ${{ matrix.cxx }} - cc: ${{ matrix.cc }} - extra-args: ${{ format('-D BOOST_SRC_DIR=boost {0}', matrix.cmake_args) }} - build-target: tests - diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b0f49292 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ + +/bazel-* +/external +/.cache +/compile_commands.json +user.bazelrc diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 00000000..4f03dc67 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "boost.outcome", + hdrs = glob([ + "include/**/*.hpp", + "include/**/*.h", + ]), + includes = ["include"], + deps = [ + "@boost.config", + "@boost.exception", + "@boost.system", + "@boost.throw_exception", + ], +) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 00000000..f8f6e06e --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,11 @@ +module( + name = "boost.outcome", + version = "1.83.0.bzl.1", + compatibility_level = 108300, +) + +bazel_dep(name = "rules_cc", version = "0.0.8") +bazel_dep(name = "boost.config", version = "1.83.0.bzl.6") +bazel_dep(name = "boost.exception", version = "1.83.0.bzl.1") +bazel_dep(name = "boost.system", version = "1.83.0.bzl.1") +bazel_dep(name = "boost.throw_exception", version = "1.83.0.bzl.1") diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel new file mode 100644 index 00000000..be0754f6 --- /dev/null +++ b/WORKSPACE.bazel @@ -0,0 +1 @@ +# SEE: MODULE.bazel