Skip to content

Commit e32cc76

Browse files
authored
Move Bazel code from iree/ into build_tools/bazel/. (iree-org#9149)
Progress on iree-org#8955. After this, the `iree/` directory will only contain the `test/` subdirectory, with minimal supporting build/test system files. * Move iree/build_defs.oss.bzl to build_tools/bazel/. Also alphabetized load() statements and added copyright headers to files that were missing them. * Move config_settings from iree/BUILD.bazel to build_tools/bazel/. Also cleaned up some related Bazel files. * Set Bazel's default lit.cfg.py from //iree to //iree/test. Compiler/ overrides it as needed. Only iree/test/ relies on the default.
1 parent 74cc6bc commit e32cc76

File tree

125 files changed

+161
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+161
-178
lines changed

BUILD.bazel

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@
44
# See https://llvm.org/LICENSE.txt for license information.
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

7-
# Note that project-wide, bazel repo aliases are used. Various scripts and helpers operate on the
8-
# following prefixes textually, so avoid doing any systematic construction that would break the
9-
# matching.
10-
#
11-
# "@absl_py//absl/"
12-
# "@bazel_skylib//"
13-
# "@com_google_benchmark//"
14-
# "@cpuinfo//"
15-
# "@cuda//"
16-
# "@com_github_dvidelabs_flatcc//"
17-
# "@com_google_googletest//"
18-
# "@llvm-project//"
19-
# "@mlir-hlo//"
20-
# "@iree_pybind11//"
21-
# "@spirv_cross//"
22-
# "@vulkan_headers//"
23-
# "@com_github_yaml_libyaml//"
24-
257
package(
268
default_visibility = ["//visibility:public"],
279
features = ["layering_check"],

build_tools/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ package(
1515
cc_library(
1616
name = "default_linkopts",
1717
linkopts = select({
18-
"//iree:iree_is_msvc": [],
19-
"//iree:iree_is_android": [
18+
"//build_tools/bazel:iree_is_msvc": [],
19+
"//build_tools/bazel:iree_is_android": [
2020
# Android provides its own pthreads support with no linking required.
2121
],
2222
"//conditions:default": [
@@ -29,8 +29,8 @@ cc_library(
2929
cc_library(
3030
name = "dl",
3131
linkopts = select({
32-
"//iree:iree_is_msvc": [],
33-
"//iree:iree_is_android": [
32+
"//build_tools/bazel:iree_is_msvc": [],
33+
"//build_tools/bazel:iree_is_android": [
3434
"-ldl",
3535
],
3636
"//conditions:default": [
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,12 @@
44
# See https://llvm.org/LICENSE.txt for license information.
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

7-
# Main IREE build file.
8-
97
package(
108
default_visibility = ["//visibility:public"],
119
features = ["layering_check"],
1210
licenses = ["notice"], # Apache 2.0
1311
)
1412

15-
exports_files(["lit.cfg.py"])
16-
17-
# Enables the debug service and other profiling features.
18-
# $ bazel build --define=IREE_DEBUG=1 :some_target
19-
config_setting(
20-
name = "debug",
21-
define_values = {"IREE_DEBUG": "1"},
22-
)
23-
24-
config_setting(
25-
name = "enable_tensorflow",
26-
define_values = {
27-
"iree_tensorflow": "true",
28-
},
29-
)
30-
3113
# Note that the "proper" way to do this is via a query on @bazel_tools,
3214
# but as with so many things bazel, it doesn't work reliably across versions,
3315
# variants, etc. So we just define our own since we also own the config

build_tools/bazel/iree_lit_test.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ load(":lit_test.bzl", "lit_test", "lit_test_suite")
1010

1111
def iree_lit_test(
1212
name,
13-
cfg = "//iree:lit.cfg.py",
13+
cfg = "//iree/test:lit.cfg.py",
1414
tools = None,
1515
env = None,
1616
**kwargs):
@@ -54,7 +54,7 @@ def iree_lit_test(
5454

5555
def iree_lit_test_suite(
5656
name,
57-
cfg = "//iree:lit.cfg.py",
57+
cfg = "//iree/test:lit.cfg.py",
5858
tools = None,
5959
env = None,
6060
**kwargs):

compiler/src/iree/compiler/API/BUILD

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# NOTE: This must be BUILD.bazel (not BUILD) because otherwise, you can't
2-
# build python packages in this directory (which creates "build" directories)
3-
# on case-inensitive file systems.
4-
load("//iree:build_defs.oss.bzl", "iree_compiler_cc_library")
1+
# Copyright 2022 The IREE Authors
2+
#
3+
# Licensed under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
7+
load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library")
58

69
package(
710
default_visibility = ["//visibility:public"],

compiler/src/iree/compiler/Bindings/Native/Transforms/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# See https://llvm.org/LICENSE.txt for license information.
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

7-
load("//iree:build_defs.oss.bzl", "iree_compiler_cc_library")
7+
load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library")
88

99
package(
1010
default_visibility = ["//visibility:public"],

compiler/src/iree/compiler/Bindings/TFLite/Transforms/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# See https://llvm.org/LICENSE.txt for license information.
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

7-
load("//iree:build_defs.oss.bzl", "iree_compiler_cc_library")
7+
load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library")
88

99
package(
1010
default_visibility = ["//visibility:public"],

compiler/src/iree/compiler/Codegen/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# See https://llvm.org/LICENSE.txt for license information.
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

7-
load("//iree:build_defs.oss.bzl", "iree_compiler_cc_library")
7+
load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library")
88
load("//build_tools/bazel:iree_tablegen.bzl", "iree_gentbl_cc_library")
99

1010
package(

compiler/src/iree/compiler/Codegen/Common/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# See https://llvm.org/LICENSE.txt for license information.
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

7-
load("//iree:build_defs.oss.bzl", "iree_compiler_cc_library")
7+
load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library")
88
load("//build_tools/bazel:iree_tablegen.bzl", "iree_gentbl_cc_library")
99

1010
package(

0 commit comments

Comments
 (0)