diff options
author | 2016-07-21 15:24:55 +0000 | |
---|---|---|
committer | 2016-07-21 20:37:03 +0000 | |
commit | 5eb86fe884762c0f638ef1cb6245c25ef0f76c2f (patch) | |
tree | b09ecd52b9e06f2e71a9b200997013806414f05a /tools/osx/BUILD | |
parent | adb22af6524df64e0d09d93ef7ba904e4470c814 (diff) |
Export xcode_locator's source file under tools/osx/ to make it available for reference by future repository rules. Removes the xcode-locator binary file under tools/objc. Originally, the precompiled binary was going to be referenced, but it's easier to build from source in the repository rule.
--
MOS_MIGRATED_REVID=128063694
Diffstat (limited to 'tools/osx/BUILD')
-rw-r--r-- | tools/osx/BUILD | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/osx/BUILD b/tools/osx/BUILD new file mode 100644 index 0000000000..e496018016 --- /dev/null +++ b/tools/osx/BUILD @@ -0,0 +1,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"], +) |