summaryrefslogtreecommitdiff
path: root/absl/BUILD.bazel
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-03-23 13:25:43 -0700
committerGravatar vslashg <gfalcon@google.com>2022-03-24 15:56:14 -0400
commiteb3db08cb3a4faf2aa09a2ba4a30b442457f36cf (patch)
tree49a04c9b03bb4a998aa68772ae3a33f30ffe1869 /absl/BUILD.bazel
parentf3489c9ca64e0fad2a263e8560ee96718ac8b21b (diff)
Export of internal Abseil changes
-- 8c9dd24a6fbf9ed10ae81f9fa0bc2168558a9700 by Abseil Team <absl-team@google.com>: Improve WebAssembly detection when using Bazel. Unfortunately, the --cpu values are not standardized, and both --cpu=wasm and --cpu=wasm32 are used in the wild. Most notably, Emscripten's Bazel rules use --cpu=wasm, which was missing. While there, add support for @platforms//cpu:{wasm32,wasm64}. This change adds a dependency on @bazel_skylib, which requires adding the following http_archive() rule to the WORKSPACE file: http_archive( name = "bazel_skylib", urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz"], sha256 = "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728", ) PiperOrigin-RevId: 436815546 Change-Id: I4e1946070c6964abb12259f25a546f2d24e0992a -- 59514589043d9b0734a01f7aa7bc354f5b495eab by Abseil Team <absl-team@google.com>: Fix some typos that slipped through. PiperOrigin-RevId: 436777566 Change-Id: Ibf5c54e2671c749dc87d2bd5d36dcd220ce347d4 GitOrigin-RevId: 8c9dd24a6fbf9ed10ae81f9fa0bc2168558a9700
Diffstat (limited to 'absl/BUILD.bazel')
-rw-r--r--absl/BUILD.bazel39
1 files changed, 38 insertions, 1 deletions
diff --git a/absl/BUILD.bazel b/absl/BUILD.bazel
index d799b7fe..7cccbbba 100644
--- a/absl/BUILD.bazel
+++ b/absl/BUILD.bazel
@@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
@@ -64,7 +66,15 @@ config_setting(
)
config_setting(
- name = "wasm",
+ name = "cpu_wasm",
+ values = {
+ "cpu": "wasm",
+ },
+ visibility = [":__subpackages__"],
+)
+
+config_setting(
+ name = "cpu_wasm32",
values = {
"cpu": "wasm32",
},
@@ -72,6 +82,33 @@ config_setting(
)
config_setting(
+ name = "platforms_wasm32",
+ constraint_values = [
+ "@platforms//cpu:wasm32",
+ ],
+ visibility = [":__subpackages__"],
+)
+
+config_setting(
+ name = "platforms_wasm64",
+ constraint_values = [
+ "@platforms//cpu:wasm64",
+ ],
+ visibility = [":__subpackages__"],
+)
+
+selects.config_setting_group(
+ name = "wasm",
+ match_any = [
+ ":cpu_wasm",
+ ":cpu_wasm32",
+ ":platforms_wasm32",
+ ":platforms_wasm64",
+ ],
+ visibility = [":__subpackages__"],
+)
+
+config_setting(
name = "fuchsia",
values = {
"cpu": "fuchsia",