aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/platforms/BUILD
blob: 1b74f106eb338751f3c0fc3ed550c01c318ef416 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package(
    default_visibility = ["//visibility:public"],
)

filegroup(
    name = "package-srcs",
    srcs = [
        "platforms.BUILD",
    ],
)

filegroup(
    name = "srcs",
    srcs = glob(["**"]),
)

# These match values in //src/main/java/com/google/build/lib/util:CPU.java
constraint_setting(name = "cpu")

constraint_value(
    name = "x86_32",
    constraint_setting = ":cpu",
)

constraint_value(
    name = "x86_64",
    constraint_setting = ":cpu",
)

constraint_value(
    name = "ppc",
    constraint_setting = ":cpu",
)

constraint_value(
    name = "arm",
    constraint_setting = ":cpu",
)

constraint_value(
    name = "s390x",
    constraint_setting = ":cpu",
)

# These match values in //src/main/java/com/google/build/lib/util:OS.java
constraint_setting(name = "os")

constraint_value(
    name = "osx",
    constraint_setting = ":os",
)

constraint_value(
    name = "freebsd",
    constraint_setting = ":os",
)

constraint_value(
    name = "linux",
    constraint_setting = ":os",
)

constraint_value(
    name = "windows",
    constraint_setting = ":os",
)

# A default platform with nothing defined.
platform(name = "default_platform")

# A default platform referring to the host system. This only exists for
# internal build configurations, and so shouldn't be accessed by other packages.
platform(
    name = "host_platform",
    cpu_constraints = [
        ":x86_32",
        ":x86_64",
        ":ppc",
        ":arm",
        ":s390x",
    ],
    host_platform = True,
    os_constraints = [
        ":osx",
        ":freebsd",
        ":linux",
        ":windows",
    ],
)

platform(
    name = "target_platform",
    cpu_constraints = [
        ":x86_32",
        ":x86_64",
        ":ppc",
        ":arm",
        ":s390x",
    ],
    os_constraints = [
        ":osx",
        ":freebsd",
        ":linux",
        ":windows",
    ],
    target_platform = True,
)