Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft/BUILD.bazel
blob: 826d219e2c96772595a3cc1d5ebd592692f36e27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (c) 2026 Progmasoft.
# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1
load("@rules_cc//cc:defs.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

# The Catch3 runner, built into //:catch2. It is C++20; Catch2's headers
# still need only C++14 in the code that includes them.
cc_library(
    name = "runner",
    srcs = glob(["Runner/*.cpp"]) + [
        "Results.cpp",
        "XmlWriter.cpp",
        "//:src/catch2/catch_session.cpp",
    ],
    hdrs = glob(["Runner/*.hpp"]) + [
        "Catch3/Results.hpp",
        "Catch3/Runner.hpp",
        "Catch3/Version.hpp",
        "Catch3/XmlWriter.hpp",
    ],
    copts = select({
        "@platforms//os:windows": ["/std:c++20"],
        "//conditions:default": ["-std=c++20"],
    }),
    linkstatic = True,
    strip_include_prefix = "/src",
    deps = ["//:catch2_core"],
)

cc_library(
    name = "catch3",
    srcs = [
        "ChoiceShrinker.cpp",
        "Context.cpp",
        "PropertyEngine.cpp",
        "Snapshot.cpp",
    ],
    hdrs = [
        "Catch3.hpp",
        "Catch3/Assertions.hpp",
        "Catch3/Detail/InvalidArgument.hpp",
        "Catch3/Detail/Sequence.hpp",
        "Catch3/ForAll.hpp",
        "Catch3/Generator.hpp",
        "Catch3/Generators/Boolean.hpp",
        "Catch3/Generators/Element.hpp",
        "Catch3/Generators/Integer.hpp",
        "Catch3/Generators/Text.hpp",
        "Catch3/Generators/Tuple.hpp",
        "Catch3/Generators/Vector.hpp",
        "Catch3/Property.hpp",
        "Catch3/Random.hpp",
        "Catch3/Relations.hpp",
        "Catch3/Snapshot.hpp",
        "Catch3/Stateful.hpp",
        "Catch3/Strategy/ChoiceSource.hpp",
        "Catch3/Strategy/Containers.hpp",
        "Catch3/Strategy/Context.hpp",
        "Catch3/Strategy/Engine.hpp",
        "Catch3/Strategy/Numeric.hpp",
        "Catch3/Strategy/Strategy.hpp",
    ],
    copts = select({
        "@platforms//os:windows": ["/std:c++20"],
        "//conditions:default": ["-std=c++20"],
    }),
    strip_include_prefix = "/src",
    deps = [
        "//:catch2",
    ],
)