1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

Add support for bazel (#56)

* Add support for bazel

Bazel support for the magic_enum repository would help others using
bazel integrate this library into their projects.

This PR adds a BUILD file which enables magic_enum to be imported
seamlessly into other WORKSPACE files without having to write a custom
BUILD file.

It also adds bazel binaries & tests to enable running them via bazel
locally:

   export CC=clang ; bazel build //... ; bazel test //... ; bazel run //:example

Finally, bazel compilation artifacts are added to the gitignore file.

* Update BUILD file & specify http_archive in README

* Lint BUILD file
This commit is contained in:
FelixDuvalletKodiak 2020-10-08 00:10:15 -07:00 committed by GitHub
parent 7063621bce
commit f3b4a01ce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 83 additions and 0 deletions

View file

@ -219,6 +219,23 @@ CPMAddPackage(
)
```
Bazel is also supported, simply add to your WORKSPACE file:
```
http_archive(
name = "magic_enum",
strip_prefix = "magic_enum-<commit>",
urls = ["https://github.com/Neargye/magic_enum/archive/<commit>.zip"],
)
```
To use bazel inside the repository it's possible to do:
```
bazel build //...
bazel test //...
bazel run //:example
```
(Note that you must use a supported compiler or specify it with `export CC= <compiler>`.)
## Compiler compatibility
* Clang/LLVM >= 5