xref: /freebsd/contrib/libcbor/BUILD (revision b5b9517bfe394e55088f5a05882eabae7e9b7b29)
1*b5b9517bSEd Mastegenrule(
2*b5b9517bSEd Maste    name = "cbor_cmake",
3*b5b9517bSEd Maste    srcs = glob(["**"]),
4*b5b9517bSEd Maste    outs = [
5*b5b9517bSEd Maste        "libcbor.a",
6*b5b9517bSEd Maste        "cbor.h",
7*b5b9517bSEd Maste        "cbor/arrays.h",
8*b5b9517bSEd Maste        "cbor/bytestrings.h",
9*b5b9517bSEd Maste        "cbor/callbacks.h",
10*b5b9517bSEd Maste        "cbor/cbor_export.h",
11*b5b9517bSEd Maste        "cbor/common.h",
12*b5b9517bSEd Maste        "cbor/configuration.h",
13*b5b9517bSEd Maste        "cbor/data.h",
14*b5b9517bSEd Maste        "cbor/encoding.h",
15*b5b9517bSEd Maste        "cbor/floats_ctrls.h",
16*b5b9517bSEd Maste        "cbor/ints.h",
17*b5b9517bSEd Maste        "cbor/maps.h",
18*b5b9517bSEd Maste        "cbor/serialization.h",
19*b5b9517bSEd Maste        "cbor/streaming.h",
20*b5b9517bSEd Maste        "cbor/strings.h",
21*b5b9517bSEd Maste        "cbor/tags.h",
22*b5b9517bSEd Maste    ],
23*b5b9517bSEd Maste    cmd = " && ".join([
24*b5b9517bSEd Maste        # Remember where output should go.
25*b5b9517bSEd Maste        "INITIAL_WD=`pwd`",
26*b5b9517bSEd Maste        "cd `dirname $(location CMakeLists.txt)`",
27*b5b9517bSEd Maste        "cmake -DCMAKE_BUILD_TYPE=Release .",
28*b5b9517bSEd Maste        "cmake --build .",
29*b5b9517bSEd Maste        # Export the .a and .h files for cbor rule, below.
30*b5b9517bSEd Maste        "cp -R src/* $$INITIAL_WD/$(RULEDIR)",
31*b5b9517bSEd Maste        "cp cbor/configuration.h $$INITIAL_WD/$(RULEDIR)/cbor",
32*b5b9517bSEd Maste    ]),
33*b5b9517bSEd Maste    visibility = ["//visibility:private"],
34*b5b9517bSEd Maste)
35*b5b9517bSEd Maste
36*b5b9517bSEd Mastecc_import(
37*b5b9517bSEd Maste    name = "cbor",
38*b5b9517bSEd Maste    hdrs = [
39*b5b9517bSEd Maste        "cbor.h",
40*b5b9517bSEd Maste        "cbor/arrays.h",
41*b5b9517bSEd Maste        "cbor/bytestrings.h",
42*b5b9517bSEd Maste        "cbor/callbacks.h",
43*b5b9517bSEd Maste        "cbor/cbor_export.h",
44*b5b9517bSEd Maste        "cbor/common.h",
45*b5b9517bSEd Maste        "cbor/configuration.h",
46*b5b9517bSEd Maste        "cbor/data.h",
47*b5b9517bSEd Maste        "cbor/encoding.h",
48*b5b9517bSEd Maste        "cbor/floats_ctrls.h",
49*b5b9517bSEd Maste        "cbor/ints.h",
50*b5b9517bSEd Maste        "cbor/maps.h",
51*b5b9517bSEd Maste        "cbor/serialization.h",
52*b5b9517bSEd Maste        "cbor/streaming.h",
53*b5b9517bSEd Maste        "cbor/strings.h",
54*b5b9517bSEd Maste        "cbor/tags.h",
55*b5b9517bSEd Maste    ],
56*b5b9517bSEd Maste    static_library = "libcbor.a",
57*b5b9517bSEd Maste    visibility = ["//visibility:public"],
58*b5b9517bSEd Maste)
59