aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/osx/BUILD
blob: e49601801656897ca373c19e11f931d783cb0857 (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
package(default_visibility = ["//visibility:public"])

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

exports_files([
    "xcode_locator.m",
])

DARWIN_XCODE_LOCATOR_COMPILE_COMMAND = """
  /usr/bin/xcrun clang -fobjc-arc -framework CoreServices \
      -framework Foundation -o $@ $<
"""

genrule(
    name = "xcode-locator-genrule",
    srcs = select({
        ":darwin": ["xcode_locator.m"],
        ":darwin_x86_64": ["xcode_locator.m"],
        "//conditions:default": ["xcode_locator_stub.sh"],
    }),
    outs = ["xcode-locator"],
    cmd = select({
        ":darwin": DARWIN_XCODE_LOCATOR_COMPILE_COMMAND,
        ":darwin_x86_64": DARWIN_XCODE_LOCATOR_COMPILE_COMMAND,
        "//conditions:default": "cp $< $@",
    }),
    local = 1,
    output_to_bindir = 1,
)

# TODO(cparsons): Consolidate with config_settings under //src
config_setting(
    name = "darwin",
    values = {"cpu": "darwin"},
    visibility = ["//visibility:public"],
)

config_setting(
    name = "darwin_x86_64",
    values = {"cpu": "darwin_x86_64"},
    visibility = ["//visibility:public"],
)