Skip to content

Commit

Permalink
Merge pull request #151 from Sythanis/master
Browse files Browse the repository at this point in the history
Initial Bazel Targets. Thanks @Sythanis !
  • Loading branch information
dingelish authored Aug 9, 2019
2 parents b8b1100 + 5a79278 commit 3f51b97
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 0 deletions.
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 = [],
)

0 comments on commit 3f51b97

Please sign in to comment.