diff --git a/WORKSPACE b/WORKSPACE index b232298823d92977f523e6bd18b6be35ec386c6a..247e552ba11737fab8df5d5cbb658efe166eb8d9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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", ) diff --git a/mace/core/BUILD b/mace/core/BUILD index 8b63a4b1ea8a55539134c8421a02f462c5f08ff9..2da78ebb37005e2efe65173e59cf1ebdc498c94e 100644 --- a/mace/core/BUILD +++ b/mace/core/BUILD @@ -15,5 +15,6 @@ cc_library( deps = [ "//mace/proto:cc_proto", ], + copts = ['-std=c++11'], ) diff --git a/mace/examples/BUILD b/mace/examples/BUILD index e932dd3804d0e139a3cadcee4ee7de4bbfef1086..55cb535cf4f3b5252f6500574788d91fc471a26e 100644 --- a/mace/examples/BUILD +++ b/mace/examples/BUILD @@ -1,8 +1,5 @@ # Examples -load( - "//mace:mace.bzl", - "if_android", - ) +load("//mace:mace.bzl", "if_android") cc_binary( name = "helloworld", diff --git a/mace/ops/BUILD b/mace/ops/BUILD index 9443f7a39c71473f0e9e6a37980703a0bab4d755..f6fede3439c065336fd68499c5386417c0decbf3 100644 --- a/mace/ops/BUILD +++ b/mace/ops/BUILD @@ -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", + ]) ) diff --git a/mace/proto/BUILD b/mace/proto/BUILD index bb2512bcf34f95a703760010e7592bc8f1ec4e39..c0ed882089995094b2933247e6d35bf73e2e12d9 100644 --- a/mace/proto/BUILD +++ b/mace/proto/BUILD @@ -13,4 +13,4 @@ proto_library( cc_proto_library( name = "cc_proto", deps = [":proto"], -) \ No newline at end of file +) diff --git a/mace/third_party/gtest.BUILD b/mace/third_party/gtest.BUILD index be8010ba780f6b12f88cdbecd3263793c006b5f6..b1ae15a9193092f6daf72d19efb171df2d9ff268 100644 --- a/mace/third_party/gtest.BUILD +++ b/mace/third_party/gtest.BUILD @@ -1,19 +1,28 @@ -# 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"], +)