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

Fix android build

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