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:
parent
7063621bce
commit
f3b4a01ce2
4 changed files with 83 additions and 0 deletions
63
BUILD.bazel
Normal file
63
BUILD.bazel
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
licenses(["notice"])
|
||||
|
||||
exports_files(["LICENSE"])
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
cc_library(
|
||||
name = "magic_enum",
|
||||
hdrs = ["include/magic_enum.hpp"],
|
||||
includes = ["include"],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "example",
|
||||
srcs = ["example/example.cpp"],
|
||||
copts = ["-std=c++17"],
|
||||
deps = [":magic_enum"],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "enum_flag_example",
|
||||
srcs = ["example/enum_flag_example.cpp"],
|
||||
copts = ["-std=c++17"],
|
||||
deps = [":magic_enum"],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "example_custom_name",
|
||||
srcs = ["example/example_custom_name.cpp"],
|
||||
copts = ["-std=c++17"],
|
||||
deps = [":magic_enum"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "catch",
|
||||
srcs = [],
|
||||
hdrs = ["test/3rdparty/Catch2/catch.hpp"],
|
||||
strip_include_prefix = "test/3rdparty/Catch2",
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "test",
|
||||
srcs = [
|
||||
"test/test.cpp",
|
||||
],
|
||||
copts = ["-std=c++17"],
|
||||
deps = [
|
||||
":catch",
|
||||
":magic_enum",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "test_flags",
|
||||
srcs = [
|
||||
"test/test_flags.cpp",
|
||||
],
|
||||
copts = ["-std=c++17"],
|
||||
deps = [
|
||||
":catch",
|
||||
":magic_enum",
|
||||
],
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue