blob: 2518532089c9bb6d45c22607424bf1b8fdd5a346 [file]
# Copyright 2019 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
licenses = ["notice"], # Apache 2.0
)
exports_files(["assert_empty_query.sh"])
# Helper tool for the IREE compiler ABI symbol rename (see renamed_link.bzl).
py_binary(
name = "gen_rename_map",
srcs = ["gen_rename_map.py"],
)
py_test(
name = "gen_rename_map_test",
srcs = [
"gen_rename_map.py",
"gen_rename_map_test.py",
],
)
# Note that the "proper" way to do this is via a query on @bazel_tools,
# but as with so many things bazel, it doesn't work reliably across versions,
# variants, etc. So we just define our own since we also own the config
# setting that activates it.
config_setting(
name = "iree_is_msvc",
define_values = {
"iree_is_msvc": "true",
},
)
# Same as above. Should be a query on @bazel_tools but this is simpler for now.
config_setting(
name = "iree_is_android",
define_values = {
"iree_is_android": "true",
},
)
# OS platform constraints. Used in select() for platform-specific backend
# selection. bazel_to_cmake maps these to CMAKE_SYSTEM_NAME checks.
config_setting(
name = "iree_is_linux",
constraint_values = ["@platforms//os:linux"],
)
config_setting(
name = "iree_is_macos",
constraint_values = ["@platforms//os:macos"],
)
# Generic RISC-V 64-bit targets. Include the CPU constraint because
# @platforms//os:none alone would also match freestanding wasm32 targets.
config_setting(
name = "iree_is_generic_riscv64",
constraint_values = [
"@platforms//cpu:riscv64",
"@platforms//os:none",
],
)
config_setting(
name = "iree_is_windows",
constraint_values = ["@platforms//os:windows"],
)
config_setting(
name = "iree_is_wasm32",
constraint_values = ["@platforms//cpu:wasm32"],
)
config_setting(
name = "iree_is_wasm64",
constraint_values = ["@platforms//cpu:wasm64"],
)
config_setting(
name = "iree_is_emscripten",
constraint_values = ["@platforms//os:emscripten"],
)
selects.config_setting_group(
name = "iree_is_wasm",
match_any = [
":iree_is_wasm32",
":iree_is_wasm64",
":iree_is_emscripten",
],
)
# Selects a user-provided system allocator. Users must provide
# IREE_ALLOCATOR_SYSTEM_CTL, and optionally IREE_ALLOCATOR_SYSTEM_SELF, via
# their own copts/defines and link the implementation into final binaries.
config_setting(
name = "iree_allocator_system_custom",
define_values = {
"iree_allocator_system": "custom",
},
)
# Selects a user-provided freestanding WebAssembly libc. The wasm toolchains
# keep the freestanding target model but stop injecting IREE's libc headers; users
# must provide their own declared headers, include paths, and allocator/libc
# objects.
config_setting(
name = "iree_wasm_libc_custom",
define_values = {
"iree_wasm_libc": "custom",
},
)
# ROCM GPU chip target for test and sample compilation. Override with:
# --//build_tools/bazel:rocm_test_target=gfx942
string_flag(
name = "rocm_test_target",
build_setting_default = "gfx1100",
)