Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Bazel Targets #151

Merged
merged 1 commit into from Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.28.1
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ samplecode/**/target

#generated assembly
third_party/ring/pregenerated

#Bazel
.clwb
bazel-bin
bazel-genfiles
bazel-out
bazel-rust-sgx-sdk
bazel-testlogs
37 changes: 37 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

##############################################
# #
# Rust #
# #
##############################################
http_archive(
name = "io_bazel_rules_rust",
sha256 = "29d9fc1cdbd737c51db5983d1ac8e64cdc684c4683bafbcc624d3d81de92a32f",
strip_prefix = "rules_rust-8417c8954efbd0cefc8dd84517b2afff5e907d5a",
urls = [
"https://github.com/bazelbuild/rules_rust/archive/8417c8954efbd0cefc8dd84517b2afff5e907d5a.tar.gz",
],
)

http_archive(
name = "bazel_skylib",
sha256 = "eb5c57e4c12e68c0c20bc774bfbc60a568e800d025557bc4ea022c6479acc867",
strip_prefix = "bazel-skylib-0.6.0",
url = "https://github.com/bazelbuild/bazel-skylib/archive/0.6.0.tar.gz",
)

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repository_set")

rust_repository_set(
name = "rust_linux_x86_64",
exec_triple = "x86_64-unknown-linux-gnu",
extra_target_triples = [],
iso_date = "2019-05-22",
version = "nightly",
)

load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")

bazel_version(name = "bazel_version")
10 changes: 10 additions & 0 deletions sgx_libc/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")

rust_library(
name = "sgx_libc",
srcs = glob(["src/*.rs"]),
crate_features = ["align"],
edition = "2018",
visibility = ["//visibility:public"],
deps = ["//sgx_types"],
)
12 changes: 12 additions & 0 deletions sgx_trts/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")

rust_library(
name = "sgx_trts",
srcs = glob(["src/*.rs"]),
edition = "2018",
visibility = ["//visibility:public"],
deps = [
"//sgx_libc",
"//sgx_types",
],
)
9 changes: 9 additions & 0 deletions sgx_types/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")

rust_library(
name = "sgx_types",
visibility = ["//visibility:public"],
edition = "2018",
srcs = glob(["src/*.rs"]),
deps = [],
)