jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 1 | # Copyright 2018 The Bazel Authors. All rights reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # This becomes the BUILD file for @local_config_cc// under FreeBSD. |
| 16 | |
| 17 | package(default_visibility = ["//visibility:public"]) |
| 18 | |
rosica | 5ee6d35 | 2019-08-09 07:24:36 -0700 | [diff] [blame] | 19 | load(":cc_toolchain_config.bzl", "cc_toolchain_config") |
plf | 8daa514 | 2019-07-22 02:25:33 -0700 | [diff] [blame] | 20 | load("@rules_cc//cc:defs.bzl", "cc_toolchain_suite", "cc_toolchain", "cc_library") |
rosica | 71bc38f | 2019-02-04 02:39:30 -0800 | [diff] [blame] | 21 | |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 22 | cc_library( |
| 23 | name = "malloc", |
| 24 | ) |
| 25 | |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 26 | filegroup( |
| 27 | name = "empty", |
| 28 | srcs = [], |
| 29 | ) |
| 30 | |
| 31 | # Hardcoded toolchain, legacy behaviour. |
| 32 | cc_toolchain_suite( |
| 33 | name = "toolchain", |
| 34 | toolchains = { |
| 35 | "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a", |
| 36 | "freebsd|compiler": ":cc-compiler-freebsd", |
rosica | 547bf42 | 2018-09-06 02:10:02 -0700 | [diff] [blame] | 37 | "armeabi-v7a": ":cc-compiler-armeabi-v7a", |
| 38 | "freebsd": ":cc-compiler-freebsd", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 39 | }, |
| 40 | ) |
| 41 | |
| 42 | cc_toolchain( |
| 43 | name = "cc-compiler-freebsd", |
| 44 | all_files = ":empty", |
Googler | 28953cb | 2018-12-05 10:46:00 -0800 | [diff] [blame] | 45 | ar_files = ":empty", |
| 46 | as_files = ":empty", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 47 | compiler_files = ":empty", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 48 | dwp_files = ":empty", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 49 | linker_files = ":empty", |
| 50 | objcopy_files = ":empty", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 51 | strip_files = ":empty", |
| 52 | supports_param_files = 0, |
hlopko | 1a25668 | 2019-10-24 07:01:01 -0700 | [diff] [blame^] | 53 | toolchain_config = ":local_freebsd", |
| 54 | toolchain_identifier = "local_freebsd", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 55 | ) |
| 56 | |
rosica | 71bc38f | 2019-02-04 02:39:30 -0800 | [diff] [blame] | 57 | cc_toolchain_config( |
| 58 | name = "local_freebsd", |
| 59 | cpu = "freebsd", |
rosica | 71bc38f | 2019-02-04 02:39:30 -0800 | [diff] [blame] | 60 | ) |
| 61 | |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 62 | toolchain( |
| 63 | name = "cc-toolchain-freebsd", |
| 64 | exec_compatible_with = [ |
hlopko | 71a213c | 2019-06-21 02:01:33 -0700 | [diff] [blame] | 65 | "@platforms//cpu:x86_64", |
| 66 | "@platforms//os:freebsd", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 67 | ], |
| 68 | target_compatible_with = [ |
hlopko | 71a213c | 2019-06-21 02:01:33 -0700 | [diff] [blame] | 69 | "@platforms//cpu:x86_64", |
| 70 | "@platforms//os:freebsd", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 71 | ], |
| 72 | toolchain = ":cc-compiler-freebsd", |
| 73 | toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", |
| 74 | ) |
| 75 | |
| 76 | cc_toolchain( |
| 77 | name = "cc-compiler-armeabi-v7a", |
| 78 | all_files = ":empty", |
Googler | 28953cb | 2018-12-05 10:46:00 -0800 | [diff] [blame] | 79 | ar_files = ":empty", |
| 80 | as_files = ":empty", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 81 | compiler_files = ":empty", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 82 | dwp_files = ":empty", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 83 | linker_files = ":empty", |
| 84 | objcopy_files = ":empty", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 85 | strip_files = ":empty", |
| 86 | supports_param_files = 0, |
hlopko | 1a25668 | 2019-10-24 07:01:01 -0700 | [diff] [blame^] | 87 | toolchain_config = ":stub_armeabi-v7a", |
| 88 | toolchain_identifier = "stub_armeabi-v7a", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 89 | ) |
| 90 | |
rosica | 71bc38f | 2019-02-04 02:39:30 -0800 | [diff] [blame] | 91 | cc_toolchain_config( |
| 92 | name = "stub_armeabi-v7a", |
| 93 | cpu = "armeabi-v7a", |
rosica | 71bc38f | 2019-02-04 02:39:30 -0800 | [diff] [blame] | 94 | ) |
| 95 | |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 96 | toolchain( |
| 97 | name = "cc-toolchain-armeabi-v7a", |
| 98 | exec_compatible_with = [ |
hlopko | 71a213c | 2019-06-21 02:01:33 -0700 | [diff] [blame] | 99 | "@platforms//cpu:arm", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 100 | ], |
| 101 | target_compatible_with = [ |
hlopko | 71a213c | 2019-06-21 02:01:33 -0700 | [diff] [blame] | 102 | "@platforms//cpu:arm", |
| 103 | "@platforms//os:android", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 104 | ], |
| 105 | toolchain = ":cc-compiler-armeabi-v7a", |
| 106 | toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", |
| 107 | ) |
| 108 | |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 109 | filegroup( |
| 110 | name = "link_dynamic_library", |
| 111 | srcs = ["link_dynamic_library.sh"], |
| 112 | ) |