forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Misc build and source fixes to get //iree/base/... building/testing u…
…nder bazel. Still need to do some corresponding submodule maintenance (will do in a separate PR). PiperOrigin-RevId: 273773161
- Loading branch information
1 parent
c06d20f
commit 196ad74
Showing
45 changed files
with
504 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
# Workspace file for the IREE project. | ||
workspace(name = "iree") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
# Abseil depends on starlark rules that are currently maintained outside | ||
# of Bazel. | ||
# Source: https://github.com/abseil/abseil-cpp/blob/master/WORKSPACE | ||
http_archive( | ||
name = "rules_cc", | ||
sha256 = "67412176974bfce3f4cf8bdaff39784a72ed709fc58def599d1f68710b58d68b", | ||
strip_prefix = "rules_cc-b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.zip", | ||
"https://github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.zip", | ||
], | ||
) | ||
|
||
local_repository( | ||
name = "com_google_absl", | ||
path = "third_party/abseil-cpp", | ||
) | ||
|
||
local_repository( | ||
name = "com_google_googletest", | ||
path = "third_party/googletest", | ||
) | ||
|
||
local_repository( | ||
name = "flatbuffers", | ||
path = "third_party/flatbuffers", | ||
) | ||
|
||
new_local_repository( | ||
name = "com_google_tracing_framework_cpp", | ||
path = "third_party/google_tracing_framework/bindings/cpp", | ||
build_file = "build_tools/third_party/google_tracing_framework_cpp/BUILD.bazel", | ||
) |
48 changes: 48 additions & 0 deletions
48
build_tools/third_party/google_tracing_framework_cpp/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2019 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
package( | ||
default_visibility = ["//visibility:public"], | ||
) | ||
|
||
# There are two ways to enable WTF at compile time: | ||
# 1) Arrange to add a --copt=-DWTF_ENABLE to your build. | ||
# 2) Add --define=GLOBAL_WTF_ENABLE=1 to the bazel command line | ||
# The disadvantage to #1 is that you end up building the entire codebase | ||
# with a non-standard copt. Depending on the size of your deps, this | ||
# can use a lot of resources due to inability to hit the forge cache. | ||
# | ||
# The advantage to #2 is that it narrowly scopes the copt change just to | ||
# things that depend on WTF, limiting the scope of things that need to | ||
# be compiled differently. | ||
config_setting( | ||
name = "wtf_enable", | ||
define_values = { | ||
"GLOBAL_WTF_ENABLE": "1", | ||
}, | ||
) | ||
|
||
cc_library( | ||
name = "tracing_framework_bindings_cpp", | ||
srcs = glob( | ||
["*.cc"], | ||
exclude = ["*_test.cc"], | ||
) + glob(["include/wtf/platform/*.h"]), | ||
hdrs = glob(["include/wtf/*.h"]), | ||
defines = select({ | ||
":wtf_enable": ["WTF_ENABLE"], | ||
"//conditions:default": [], | ||
}), | ||
includes = ["include"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.