Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bazel support for geometry-central #171

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

phaedon
Copy link

@phaedon phaedon commented Feb 16, 2024

This PR adds support for Bazel, as an alternative to CMake (https://bazel.build/about/why)

To build:
bazel build ...

To run all unit tests:
bazel test ...

Next steps (after this is merged):

  1. Please cut a new release on https://github.com/nmwsharp/geometry-central/releases
  2. Then I can add this repo to https://registry.bazel.build/
  3. I will add documentation to this repo's building.md to document the one-liner required to pull this into any other Bazel-based project (which will look something like bazel_dep(name = "geometry_central", version = "0.2.0"))

@phaedon
Copy link
Author

phaedon commented Feb 21, 2024

Verified that this builds and runs successfully on at least Ubuntu (x86_64) and Mac OS (ARM).

@nmwsharp
Copy link
Owner

nmwsharp commented Mar 3, 2024

Thanks for submitting this! I'm totally unfamiliar with Bazel, but it seems to be fairly widely used so it'd be nice to support.

One question: what is the maintenance requirement going forward to ensure this library continues to build well on Bazel? I'm quite wary of leaving behind stale/broken versions of the library on the long tail of various package repositories / build systems. Does it just mean updating the BUILD.bazel as files are added? Would it make sense to also add a bazel build to geometry-central's CI matrix?

@nmwsharp
Copy link
Owner

nmwsharp commented Mar 3, 2024

Also what is the .bazelrc doing? Do we need to add an additional file to the project root?

@phaedon
Copy link
Author

phaedon commented Mar 14, 2024

Great suggestion, I added a bazel.yml file to run the build and test stages on each PR.

The .bazelrc specifies a couple of basic but important settings for build:

  • C++20 version
  • "bzlmod" which reads the external dependencies (eigen and googletest) from the MODULE.bazel file
    as well as test output only on errors. I tried to add documentation to that file.

@phaedon
Copy link
Author

phaedon commented Jun 12, 2024

Just a reminder that this is ready to go in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants