提交 f0437d6e 编写于 作者: L Liangliang He

Fix android build

上级 3e506ffc
......@@ -5,24 +5,24 @@ workspace(name = "mace")
# This statement defines the @com_google_protobuf repo.
http_archive(
name = "com_google_protobuf",
urls = ["http://v9.git.n.xiaomi.com/deep-learning/protobuf/repository/archive.zip?ref=b4b0e304be5a68de3d0ee1af9b286f958750f5e4"],
strip_prefix = "protobuf-b4b0e304be5a68de3d0ee1af9b286f958750f5e4-b4b0e304be5a68de3d0ee1af9b286f958750f5e4",
sha256 = "11087b7d623d066e9b58acf22e3d8f8433e2f3ce1248123bd61da4e109a3f30a",
urls = ["http://v9.git.n.xiaomi.com/deep-learning/protobuf/repository/archive.zip?ref=c7457ef65a7a8584b1e3bd396c401ccf8e275ffa"],
strip_prefix = "protobuf-c7457ef65a7a8584b1e3bd396c401ccf8e275ffa-c7457ef65a7a8584b1e3bd396c401ccf8e275ffa",
sha256 = "0a54cae83b77f4b54b7db4eaebadd81fbe91655e84a1ef3f6d29116d75f3a45f",
)
# cc_proto_library rules implicitly depend on @com_google_protobuf_cc//:cc_toolchain,
# which is the C++ proto runtime (base classes and common utilities).
http_archive(
name = "com_google_protobuf_cc",
urls = ["http://v9.git.n.xiaomi.com/deep-learning/protobuf/repository/archive.zip?ref=b4b0e304be5a68de3d0ee1af9b286f958750f5e4"],
strip_prefix = "protobuf-b4b0e304be5a68de3d0ee1af9b286f958750f5e4-b4b0e304be5a68de3d0ee1af9b286f958750f5e4",
sha256 = "11087b7d623d066e9b58acf22e3d8f8433e2f3ce1248123bd61da4e109a3f30a",
urls = ["http://v9.git.n.xiaomi.com/deep-learning/protobuf/repository/archive.zip?ref=c7457ef65a7a8584b1e3bd396c401ccf8e275ffa"],
strip_prefix = "protobuf-c7457ef65a7a8584b1e3bd396c401ccf8e275ffa-c7457ef65a7a8584b1e3bd396c401ccf8e275ffa",
sha256 = "0a54cae83b77f4b54b7db4eaebadd81fbe91655e84a1ef3f6d29116d75f3a45f",
)
new_http_archive(
name = "gtest",
url = "http://v9.git.n.xiaomi.com/deep-learning/googletest/repository/archive.zip?ref=release-1.8.0",
strip_prefix = "googletest-release-1.8.0-ec44c6c1675c25b9827aacd08c02433cccde7780/googletest",
strip_prefix = "googletest-release-1.8.0-ec44c6c1675c25b9827aacd08c02433cccde7780",
sha256 = "a0b43a0a43cda0cc401a46d75519d961ef27f6674d4126366e47d9c946c4bbcd",
build_file = "mace/third_party/gtest.BUILD",
)
......
......@@ -15,5 +15,6 @@ cc_library(
deps = [
"//mace/proto:cc_proto",
],
copts = ['-std=c++11'],
)
# Examples
load(
"//mace:mace.bzl",
"if_android",
)
load("//mace:mace.bzl", "if_android")
cc_binary(
name = "helloworld",
......
......@@ -8,6 +8,8 @@ package(
licenses(["notice"]) # Apache 2.0
load("//mace:mace.bzl", "if_android")
cc_library(
name = "ops",
srcs = ["relu.cc"],
......@@ -16,14 +18,20 @@ cc_library(
"//mace/proto:cc_proto",
"//mace/core:core",
],
copts = ['-std=c++11'],
)
cc_test(
name = "relu_test",
srcs = ["relu_test.cc",],
deps = [
"@gtest//:gtest",
"@gtest//:gtest_main",
":ops",
],
copts = ['-std=c++11'],
linkopts = if_android([
"-pie",
"-llog",
])
)
......@@ -13,4 +13,4 @@ proto_library(
cc_proto_library(
name = "cc_proto",
deps = [":proto"],
)
\ No newline at end of file
)
# Description:
# Google test
licenses(["notice"])
cc_library(
name = "gtest",
srcs = glob(
["src/*.cc"],
exclude = ["src/gtest-all.cc"]
),
srcs = [
"googletest/src/gtest-all.cc",
"googlemock/src/gmock-all.cc",
],
hdrs = glob([
"include/**/*.h",
"src/*.h"
"**/*.h",
"googletest/src/*.cc",
"googlemock/src/*.cc",
]),
copts = ["-Iexternal/gtest/include"],
includes = [
"googlemock",
"googletest",
"googletest/include",
"googlemock/include",
],
linkopts = ["-pthread"],
visibility = ["//visibility:public"],
)
cc_library(
name = "gtest_main",
srcs = ["googlemock/src/gmock_main.cc"],
linkopts = ["-pthread"],
visibility = ["//visibility:public"],
)
\ No newline at end of file
deps = [":gtest"],
)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册