Skip to content

Commit

Permalink
Add bazel support (#361)
Browse files Browse the repository at this point in the history
Fixes #53
  • Loading branch information
spendres authored Sep 5, 2024
1 parent 713f9c2 commit ca1f341
Show file tree
Hide file tree
Showing 18 changed files with 1,755 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,29 @@ The Python API is particularly unstable, and it is planned that the SWIGged
API will be replaced by a pybind11 version with more Pythonic names and more
complete functionality.

## Requirements for End Users
## Requirements for End Users using Bazel

## Build

This bazel build requires 7.0.0 – bzlmod default. Builds were tested using
C++20 as set in .bazelrc. This setup relies on abseil-cpp, boringssl, and
googletest from the bazel central repository as set in MODULE.bazel.

To build and test using bazel, from within s2geometry/src, run:

`bazel test "//:*"`

To build the libary without testing, from within s2geometry/src, run:

`bazel build //:s2`

## Status

All tests enumerated in the BUILD.bazel file pass on x86 machines. On
Apple M1, s2loop_measures_test fails due to a 6% excess accumlated error.
This issue may require revision of boringssl or exactfloat.

## Requirements for End Users using CMake

* [CMake](http://www.cmake.org/)
* A C++ compiler with C++14 support, such as [g++ >= 5](https://gcc.gnu.org/)
Expand Down
3 changes: 3 additions & 0 deletions src/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
common --cxxopt=-std=c++20
Loading

0 comments on commit ca1f341

Please sign in to comment.