aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted/aws/aws-c-cal/.yandex_meta/__init__.py
blob: 54f4b1b1833a1bd707466c0203a45747755c5ce1 (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
from devtools.yamaker.fileutil import files
from devtools.yamaker.modules import Linkable, Switch, Words
from devtools.yamaker.project import CMakeNinjaNixProject


def post_install(self):
    m = self.yamakes["."]

    # Support Darwin.
    linux_srcs = files(self.srcdir + "/source/unix/", rel=self.srcdir)
    darwin_srcs = files(self.srcdir + "/source/darwin/", rel=self.srcdir)
    windows_srcs = files(self.srcdir + "/source/windows/", rel=self.srcdir)
    m.SRCS -= set(linux_srcs)
    m.after(
        "SRCS",
        Switch(
            OS_LINUX=Linkable(SRCS=linux_srcs),
            OS_DARWIN=Linkable(
                SRCS=darwin_srcs,
                LDFLAGS=[Words("-framework", "Security")],
            ),
            OS_WINDOWS=Linkable(SRCS=windows_srcs),
        ),
    )
    m.after(
        "CFLAGS",
        Switch(
            OS_WINDOWS=Linkable(
                CFLAGS=["-DAWS_CAL_EXPORTS"],
            ),
        ),
    )


aws_c_cal = CMakeNinjaNixProject(
    arcdir="contrib/restricted/aws/aws-c-cal",
    nixattr="aws-c-cal",
    copy_sources=[
        "source/darwin/",
        "source/windows/",
    ],
    ignore_targets=["sha256_profile"],
    post_install=post_install,
)