|
| 1 | +# Copyright (C) 2022 Swift Navigation Inc. |
| 2 | +# Contact: Swift Navigation <dev@swift-nav.com> |
| 3 | +# |
| 4 | +# This source is subject to the license found in the file 'LICENSE' which must |
| 5 | +# be be distributed together with this source. All other rights reserved. |
| 6 | +# |
| 7 | +# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, |
| 8 | +# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED |
| 9 | +# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. |
| 10 | + |
| 11 | +package(default_visibility = ["//visibility:public"]) |
| 12 | + |
| 13 | +load("//cc/toolchains/llvm:cc_toolchain_config.bzl", "cc_toolchain_config") |
| 14 | + |
| 15 | +filegroup( |
| 16 | + name = "wrappers", |
| 17 | + srcs = glob([ |
| 18 | + "wrappers/**", |
| 19 | + ]), |
| 20 | + visibility = ["//visibility:public"], |
| 21 | +) |
| 22 | + |
| 23 | +filegroup( |
| 24 | + name = "ar_files", |
| 25 | + srcs = [ |
| 26 | + ":wrappers", |
| 27 | + "@aarch64-darwin-llvm//:ar", |
| 28 | + ], |
| 29 | +) |
| 30 | + |
| 31 | +filegroup( |
| 32 | + name = "as_files", |
| 33 | + srcs = [ |
| 34 | + ":wrappers", |
| 35 | + "@aarch64-darwin-llvm//:as", |
| 36 | + ], |
| 37 | +) |
| 38 | + |
| 39 | +filegroup( |
| 40 | + name = "compiler_files", |
| 41 | + srcs = [ |
| 42 | + ":wrappers", |
| 43 | + "@aarch64-darwin-llvm//:clang", |
| 44 | + "@aarch64-darwin-llvm//:include", |
| 45 | + ], |
| 46 | +) |
| 47 | + |
| 48 | +filegroup( |
| 49 | + name = "dwp_files", |
| 50 | + srcs = [ |
| 51 | + ":wrappers", |
| 52 | + "@aarch64-darwin-llvm//:dwp", |
| 53 | + ], |
| 54 | +) |
| 55 | + |
| 56 | +filegroup( |
| 57 | + name = "linker_files", |
| 58 | + srcs = [ |
| 59 | + ":wrappers", |
| 60 | + "@aarch64-darwin-llvm//:ar", |
| 61 | + "@aarch64-darwin-llvm//:clang", |
| 62 | + "@aarch64-darwin-llvm//:lib", |
| 63 | + ], |
| 64 | +) |
| 65 | + |
| 66 | +filegroup( |
| 67 | + name = "objcopy_files", |
| 68 | + srcs = [ |
| 69 | + ":wrappers", |
| 70 | + "@aarch64-darwin-llvm//:objcopy", |
| 71 | + ], |
| 72 | +) |
| 73 | + |
| 74 | +filegroup( |
| 75 | + name = "strip_files", |
| 76 | + srcs = [ |
| 77 | + ":wrappers", |
| 78 | + "@aarch64-darwin-llvm//:strip", |
| 79 | + ], |
| 80 | +) |
| 81 | + |
| 82 | +filegroup( |
| 83 | + name = "all_files", |
| 84 | + srcs = [ |
| 85 | + "linker_files", |
| 86 | + ":compiler_files", |
| 87 | + "@aarch64-darwin-llvm//:bin", |
| 88 | + ], |
| 89 | +) |
| 90 | + |
| 91 | +cc_toolchain_config( |
| 92 | + name = "local-aarch64-darwin", |
| 93 | + abi_libc_version = "darwin_aarch64", |
| 94 | + abi_version = "darwin_aarch64", |
| 95 | + builtin_sysroot = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk", |
| 96 | + compiler = "clang", |
| 97 | + cxx_builtin_include_directories = [ |
| 98 | + "%sysroot%/usr/include", |
| 99 | + "%sysroot%/System/Library/Frameworks", |
| 100 | + ], |
| 101 | + host_system_name = "darwin-aarch64", |
| 102 | + is_darwin = True, |
| 103 | + target_cpu = "darwin", |
| 104 | + target_libc = "macosx", |
| 105 | + target_system_name = "aarch64-apple-macosx", |
| 106 | + tool_paths = { |
| 107 | + "ar": "/usr/bin/libtool", |
| 108 | + "cpp": "wrappers/clang-cpp", |
| 109 | + "gcc": "wrappers/clang", |
| 110 | + "gcov": "wrappers/llvm-profdata", |
| 111 | + "llvm-cov": "wrappers/llvm-cov", |
| 112 | + "llvm-profdata": "wrappers/llvm-profdata", |
| 113 | + "ld": "/usr/bin/ld", |
| 114 | + "nm": "wrappers/llvm-nm", |
| 115 | + "objcopy": "wrappers/llvm-objcopy", |
| 116 | + "objdump": "wrappers/llvm-objdump", |
| 117 | + "strip": "wrappers/llvm-strip", |
| 118 | + }, |
| 119 | + toolchain_identifier = "clang-aarch64-darwin", |
| 120 | + toolchain_path_prefix = "external/aarch64-darwin-llvm", |
| 121 | +) |
| 122 | + |
| 123 | +cc_toolchain( |
| 124 | + name = "cc-clang-aarch64-darwin", |
| 125 | + all_files = ":all_files", |
| 126 | + ar_files = ":ar_files", |
| 127 | + as_files = ":as_files", |
| 128 | + compiler_files = ":compiler_files", |
| 129 | + dwp_files = ":dwp_files", |
| 130 | + linker_files = ":linker_files", |
| 131 | + objcopy_files = ":objcopy_files", |
| 132 | + strip_files = ":strip_files", |
| 133 | + toolchain_config = ":local-aarch64-darwin", |
| 134 | +) |
| 135 | + |
| 136 | +toolchain( |
| 137 | + name = "cc-toolchain-aarch64-darwin", |
| 138 | + exec_compatible_with = [ |
| 139 | + "@platforms//cpu:aarch64", |
| 140 | + "@platforms//os:macos", |
| 141 | + ], |
| 142 | + target_compatible_with = [ |
| 143 | + "@platforms//cpu:aarch64", |
| 144 | + "@platforms//os:macos", |
| 145 | + ], |
| 146 | + target_settings = None, |
| 147 | + toolchain = ":cc-clang-aarch64-darwin", |
| 148 | + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", |
| 149 | +) |
0 commit comments