Coder Social home page Coder Social logo

rules_boost's Introduction

rules_boost -- Bazel build rules for Boost

Copy this into your Bazel WORKSPACE file to add this repo as an external dependency, making sure to update to the latest commit per the instructions below.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Boost
# Famous C++ library that has given rise to many new additions to the C++ Standard Library
# Makes @boost available for use: For example, add `@boost//:algorithm` to your deps.
# For more, see https://github.com/nelhage/rules_boost and https://www.boost.org
http_archive(
    name = "com_github_nelhage_rules_boost",

    # Replace the commit hash in both places (below) with the latest, rather than using the stale one here.
    # Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
    url = "https://github.com/nelhage/rules_boost/archive/96e9b631f104b43a53c21c87b01ac538ad6f3b48.tar.gz",
    strip_prefix = "rules_boost-96e9b631f104b43a53c21c87b01ac538ad6f3b48",
    # When you first run this tool, it'll recommend a sha256 hash to put here with a message like: "DEBUG: Rule 'com_github_nelhage_rules_boost' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = ..."
)
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()

You can now use libraries in deps through the @boost repository, for example @boost//:algorithm.

If you're using the Apple or Android-specific rules...

As with all platform-dependent C/C++ in Bazel, you'll need to set up platform_mappings until Bazel resolves its outstanding issues.

It's not hard if you know what to to do, but can be tricky to figure out. If you'd like help with this, please let us know over at hedronvision/bazel-make-cc-https-easy#4

Suggestion: Updates

Improvements come frequently to the underlying libraries, including security patches, so we'd recommend keeping up-to-date.

We'd strongly recommend you set up Renovate (or similar) at some point to keep this dependency (and others) up-to-date by default. [We aren't affiliated with Renovate or anything, but we think it's awesome. It watches for new versions and sends you PRs for review or automated testing. It's free and easy to set up. It's been astoundingly useful in our codebase, and we've worked with the wonderful maintainer to make things great for Bazel use. And it's used in official Bazel repositories--and this one!]

If not now, maybe come back to this step later, or watch this repo for updates. [Or hey, maybe give us a quick star, while you're thinking about watching.] Like Abseil, we live at head; the latest commit to the main branch is the commit you want. So don't rely on release notifications; use Renovate or poll manually for new commits.

Configuration of Sub-Libraries

ASIO

SSL Support

These rules implement support for Boost ASIO's SSL support. To use ASIO-SSL, you must depend on the "@boost//:asio_ssl" target, instead of "@boost//:asio". ASIO-SSL depends on OpenSSL; By default, rules_boost will download and build the latest BoringSSL commit; To use a different OpenSSL implementation, create a remote named openssl before calling boost_deps. This remote must make available OpenSSL's libssl at @openssl//:ssl.

io_uring support

To enable io_uring for asio, use --@boost//:asio_has_io_uring. Optionally, pass--@boost//:asio_disable_epoll to use io_uring for all operations.

Beast

Boost Beast uses beast::string_view for things like request/response headers, which by default is a type alias of boost::string_view. If you're using a C++17 compiler that supports std::string_view you can use --@boost//:beast_use_std_string_view to make beast::string_view instead be a type alias of std::string_view.


Based in part on rules from https://github.com/mzhaom/trunk.

rules_boost's People

Contributors

akovachev avatar an-to-nio avatar andrewrademacher avatar anrodrig avatar arfaian avatar benjaminp avatar cpsauer avatar dprogm avatar drigz avatar eklitzke avatar garymm avatar gjasny avatar hackattack avatar henryymliu avatar kamalmarhubi avatar mapx avatar markusteufelberger avatar nelhage avatar per-gron avatar philwo avatar renovate[bot] avatar richardcochrankodiak avatar russelltg avatar storypku avatar thebutlah avatar tmarkovich avatar vertexwahn avatar wesleyw72 avatar wijagels avatar zacvawterkodiak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.