From d05a8e2e24927509bd1ac97c86e0d00398086621 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 25 May 2020 15:44:57 +0200 Subject: [PATCH] Add Bazel support for the v3 branch --- .gitignore | 1 + BUILD.bazel | 25 +++++++++++++++++++++++++ WORKSPACE | 0 3 files changed, 26 insertions(+) create mode 100644 BUILD.bazel create mode 100644 WORKSPACE diff --git a/.gitignore b/.gitignore index f017e9e0..dd12a74b 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ Build cmake-build-* benchmark-dir .conan/test_package/build +bazel-* diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 00000000..6dc626d8 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,25 @@ +# Load the cc_library rule. +load("@rules_cc//cc:defs.bzl", "cc_library") + +# Static library, without main. +cc_library( + name = "catch2", + hdrs = glob(["src/catch2/**/*.hpp"]), + srcs = glob(["src/catch2/**/*.cpp"], + exclude=[ "src/catch2/internal/catch_main.cpp"]), + visibility = ["//visibility:public"], + copts = ["-std=c++14"], + linkstatic = True, + includes = ["src/"], +) + +# Static library, with main. +cc_library( + name = "catch2_main", + srcs = ["src/catch2/internal/catch_main.cpp"], + deps = [":catch2"], + visibility = ["//visibility:public"], + linkstatic = True, + copts = ["-std=c++14"], + includes = ["src/"], +) diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 00000000..e69de29b