aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/flatbuffers/.yandex_meta/__init__.py
blob: c96d3341e329412414046eb674a1d89fb3bcdaff (plain) (blame)
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
from devtools.yamaker import fileutil
from devtools.yamaker.project import CMakeNinjaNixProject


def post_install(self):
    # Avoid accidental inclusions between flatbuffers and flatbuffers64 headers.
    fileutil.re_sub_dir(self.dstdir + "/include/flatbuffers", '#include "flatbuffers/', '#include "')

    with self.yamakes["flatc"] as m:
        m.after(
            "PROGRAM",
            """
            INDUCED_DEPS(
                h+cpp
                ${ARCADIA_ROOT}/contrib/libs/flatbuffers/include/flatbuffers/flatbuffers.h
                ${ARCADIA_ROOT}/contrib/libs/flatbuffers/include/flatbuffers/flatbuffers_iter.h
            )
            """,
        )

        m.SRCS.add("src/idl_gen_cpp_yandex_maps_iter.cpp")
        m.PEERDIR.add("contrib/restricted/abseil-cpp/absl/base")

    with self.yamakes["."] as m:
        # Remove ADDINCL GLOBAL to keep status quo.
        m.ADDINCL.get(self.arcdir + "/include").GLOBAL = False
        m.PEERDIR.add("contrib/restricted/abseil-cpp/absl/base")


flatbuffers = CMakeNinjaNixProject(
    owners=["g:cpp-contrib"],
    arcdir="contrib/libs/flatbuffers",
    nixattr="flatbuffers",
    put={
        "flatbuffers": ".",
        "flatc": "flatc",
    },
    copy_sources=[
        "include/flatbuffers/*.h",
    ],
    keep_paths=[
        "include/flatbuffers/flatbuffers_iter.h",
        "src/idl_gen_cpp_yandex_maps_iter.cpp",
        "src/idl_gen_cpp_yandex_maps_iter.h",
    ],
    disable_includes=[
        "absl/strings/string_view.h",
        "experimental/string_view",
        "utility.h",
        "FLATBUFFERS_ASSERT_INCLUDE",
        "FLATBUFFERS64_ASSERT_INCLUDE",
    ],
    post_install=post_install,
)