aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jeff McGlynn <jwmcglynn@google.com>2018-06-18 10:55:12 -0700
committerGravatar Jeff McGlynn <jwmcglynn@google.com>2018-06-18 11:39:04 -0700
commitce724a5f1c94f539a6bf956fc6431c37e97961a9 (patch)
tree88dc586a7b19aaa5ce4a9d927733510ad06d2be9
parenta37e15d3e186b2377aeeb1bbf8cf62f3615c841c (diff)
Set up build system and add dependencies to WORKSPACE
-rw-r--r--.gitignore2
-rw-r--r--BUILD.bazel15
-rw-r--r--WORKSPACE33
-rw-r--r--third_party/honggfuzz.BUILD34
4 files changed, 84 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..afa1830
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+bazel-*
+.bazelrc
diff --git a/BUILD.bazel b/BUILD.bazel
new file mode 100644
index 0000000..c947e83
--- /dev/null
+++ b/BUILD.bazel
@@ -0,0 +1,15 @@
+# Copyright 2018 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+licenses(["notice"])
diff --git a/WORKSPACE b/WORKSPACE
new file mode 100644
index 0000000..69e5513
--- /dev/null
+++ b/WORKSPACE
@@ -0,0 +1,33 @@
+# Copyright 2018 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+local_repository(
+ name = "gtest",
+ path = "third_party/googletest",
+)
+
+new_http_archive(
+ name = "honggfuzz",
+ url = "https://github.com/google/honggfuzz/archive/1.6.zip",
+ sha256 = "c331ac5beebe526bced3043ed3012109e439315b7d74d72760b0aa6d08cc05d2",
+ build_file = "third_party/honggfuzz.BUILD",
+ strip_prefix = "honggfuzz-1.6",
+)
+
+http_archive(
+ name = "benchmark",
+ url = "https://github.com/google/benchmark/archive/v1.4.1.zip",
+ sha256 = "61ae07eb5d4a0b02753419eb17a82b7d322786bb36ab62bd3df331a4d47c00a7",
+ strip_prefix = "benchmark-1.4.1",
+)
diff --git a/third_party/honggfuzz.BUILD b/third_party/honggfuzz.BUILD
new file mode 100644
index 0000000..67a44be
--- /dev/null
+++ b/third_party/honggfuzz.BUILD
@@ -0,0 +1,34 @@
+config_setting(
+ name = "opt",
+ values = {"compilation_mode": "opt"}
+)
+
+cc_library(
+ name = "honggfuzz",
+ srcs = glob([
+ "libhfuzz/*.c",
+ "libhfcommon/*.c",
+ ],
+ exclude = ["libhfuzz/linux.c"],
+ ) + select({
+ "@bazel_tools//src/conditions:darwin_x86_64": [],
+ "@bazel_tools//src/conditions:darwin": [],
+ "//conditions:default": ["libhfuzz/linux.c"],
+ }),
+ hdrs = glob([
+ "libhfuzz/*.h",
+ "libhfcommon/*.h",
+ "honggfuzz.h",
+ ]),
+ defines = select({
+ "@bazel_tools//src/conditions:darwin_x86_64": ["_HF_ARCH_DARWIN"],
+ "@bazel_tools//src/conditions:darwin": ["_HF_ARCH_DARWIN"],
+ "//conditions:default": ["_HF_ARCH_LINUX", "linux=linux"],
+ }) + select({
+ ":opt": [],
+ "//conditions:default": ["DEBUG=DEBUG"],
+ }),
+ includes = ["."],
+ visibility = ["//visibility:public"],
+ linkstatic = 1
+)