Skip to content

Commit 6a98917

Browse files
author
Yi Wang
committed
Fix all building errors
1 parent f9f2741 commit 6a98917

File tree

6 files changed

+50
-32
lines changed

6 files changed

+50
-32
lines changed

WORKSPACE

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,25 @@ http_archive(
88
# External dependency to gtest 1.7.0. This method comes from
99
# https://www.bazel.io/versions/master/docs/tutorial/cpp.html.
1010
new_http_archive(
11-
name = "gtest",
12-
url = "https://github.com/google/googletest/archive/release-1.7.0.zip",
13-
sha256 = "b58cb7547a28b2c718d1e38aee18a3659c9e3ff52440297e965f5edffe34b6d0",
14-
build_file = "third_party/gtest.BUILD",
15-
strip_prefix = "googletest-release-1.7.0",
16-
)
11+
name="gtest",
12+
url="https://github.com/google/googletest/archive/release-1.7.0.zip",
13+
sha256="b58cb7547a28b2c718d1e38aee18a3659c9e3ff52440297e965f5edffe34b6d0",
14+
build_file="third_party/gtest.BUILD",
15+
strip_prefix="googletest-release-1.7.0", )
1716

1817
# External dependency to gflags. This method comes from
1918
# https://github.com/gflags/example/blob/master/WORKSPACE.
20-
git_repository(
21-
name = "gflags",
22-
tag = "v2.2.0",
23-
remote = "https://github.com/gflags/gflags.git"
19+
new_git_repository(
20+
name="gflags",
21+
tag="v2.2.0",
22+
remote="https://github.com/gflags/gflags.git",
23+
build_file="third_party/gflags.BUILD",
2424
)
2525

2626
# External dependency to glog. This method comes from
2727
# https://github.com/reyoung/bazel_playground/blob/master/WORKSPACE
2828
new_git_repository(
29-
name = "glog",
30-
remote = "https://github.com/google/glog.git",
31-
commit = "b6a5e0524c28178985f0d228e9eaa43808dbec3c",
32-
build_file = "third_party/glog.BUILD"
33-
)
29+
name="glog",
30+
remote="https://github.com/google/glog.git",
31+
commit="b6a5e0524c28178985f0d228e9eaa43808dbec3c",
32+
build_file="third_party/glog.BUILD")

third_party/gflags.BUILD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Bazel (http://bazel.io/) BUILD file for gflags.
2+
#
3+
# See INSTALL.md for instructions for adding gflags to a Bazel workspace.
4+
5+
licenses(["notice"])
6+
7+
exports_files(["src/gflags_complections.sh", "COPYING.txt"])
8+
9+
load(":bazel/gflags.bzl", "gflags_sources", "gflags_library")
10+
(hdrs, srcs) = gflags_sources(namespace=["google", "gflags"])
11+
gflags_library(hdrs=hdrs, srcs=srcs, threads=0)
12+
gflags_library(hdrs=hdrs, srcs=srcs, threads=1)

third_party/glog.BUILD

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ licenses(["notice"])
33
cc_library(
44
visibility = ["//visibility:public"],
55
name = "glog",
6-
deps = [
7-
#"//third_party/libunwind:libunwind-k8",
8-
"@gflags//:gflags",
9-
],
106
includes = [
117
".",
128
"src",
@@ -24,9 +20,6 @@ cc_library(
2420
"-DHAVE_INTTYPES_H",
2521
"-DHAVE_LIBPTHREAD",
2622
"-DHAVE_SYS_SYSCALL_H",
27-
#"-DHAVE_LIBUNWIND_H",
28-
"-DHAVE_LIB_GFLAGS",
29-
#"-DHAVE_LIB_UNWIND",
3023
"-DHAVE_MEMORY_H",
3124
"-DHAVE_NAMESPACES",
3225
"-DHAVE_PREAD",
@@ -51,7 +44,6 @@ cc_library(
5144
#"-fno-sanitize=thread",
5245
#"-fno-sanitize=address",
5346
"-Iexternal/glog/src",
54-
#"-I/usr/local/include", # XXX import libunwind
5547
],
5648
srcs = [
5749
"src/demangle.cc",
@@ -71,18 +63,13 @@ cc_library(
7163
"src/demangle.h",
7264
"src/mock-log.h",
7365
"src/stacktrace.h",
74-
#"src/stacktrace_libunwind-inl.h",
7566
"src/symbolize.h",
7667
"src/utilities.h",
7768
"src/base/commandlineflags.h",
7869
"src/base/googleinit.h",
7970
"src/base/mutex.h",
8071
"src/glog/log_severity.h",
8172
],
82-
linkopts = [
83-
#"-pthread",
84-
#"-L/usr/local/lib -lunwind",
85-
],
8673
)
8774

8875
genrule(

third_party/glog_test/BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
licenses(["notice"]) # Apache 2.0
2+
3+
cc_test(
4+
name = "glog_test",
5+
srcs = ["glog_test.cc"],
6+
copts = ["-Iexternal/gtest/include"],
7+
deps =[
8+
"@gtest//:gtest",
9+
"@glog//:glog",
10+
],
11+
)

third_party/glog_test/glog_test.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <iostream>
2+
#include <string>
3+
4+
#include "glog/logging.h"
5+
#include "gtest/gtest.h"
6+
7+
TEST(GlogTest, Logging) {
8+
LOG(INFO) << "Hello world";
9+
}

third_party/protobuf_test/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ cc_library(
1515
deps=[":example_proto"], )
1616

1717
cc_test(
18-
name = "example_lib_test",
19-
srcs = ["example_lib_test.cc"],
20-
copts = ["-Iexternal/gtest/include"],
21-
deps =[
18+
name="example_lib_test",
19+
srcs=["example_lib_test.cc"],
20+
copts=["-Iexternal/gtest/include"],
21+
deps=[
2222
"@gtest//:gtest",
2323
":example_lib",
2424
], )

0 commit comments

Comments
 (0)