aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarco Poletti <poletti.marco@gmail.com>2016-03-27 00:01:14 +0000
committerMarco Poletti <poletti.marco@gmail.com>2016-03-27 00:01:14 +0000
commit18fb99579e350e6be0b18f197478d46c599e53eb (patch)
treea065ecf1c291564e13ff60df248c18df80f21385 /examples
parentad9bbe4b1bcf12b8228507a365f8d6ec8d3d12f2 (diff)
downloadgoogle-fruit-18fb99579e350e6be0b18f197478d46c599e53eb.tar.gz
Support Bazel as an alternative build system (in parallel with CMake).
Diffstat (limited to 'examples')
-rw-r--r--examples/benchmark/BUILD16
-rw-r--r--examples/hello_world/BUILD6
-rw-r--r--examples/multibindings/BUILD6
-rw-r--r--examples/scaling_doubles/BUILD10
-rw-r--r--examples/server/BUILD10
-rw-r--r--examples/simple_injection/BUILD25
6 files changed, 73 insertions, 0 deletions
diff --git a/examples/benchmark/BUILD b/examples/benchmark/BUILD
new file mode 100644
index 0000000..e5f3a66
--- /dev/null
+++ b/examples/benchmark/BUILD
@@ -0,0 +1,16 @@
+
+cc_binary(
+ name = "new_delete_benchmark",
+ srcs = ["new_delete_benchmark.cpp"],
+ deps = [
+ "//:fruit",
+ ],
+)
+
+cc_binary(
+ name = "generate_benchmark",
+ srcs = ["generate_benchmark.cpp"],
+ deps = [],
+)
+
+# TODO: figure out a way to generate the benchmark in bazel (probably using a genrule)
diff --git a/examples/hello_world/BUILD b/examples/hello_world/BUILD
new file mode 100644
index 0000000..57c35ec
--- /dev/null
+++ b/examples/hello_world/BUILD
@@ -0,0 +1,6 @@
+
+cc_binary(
+ name = "hello_world",
+ srcs = ["main.cpp"],
+ deps = ["//:fruit"],
+)
diff --git a/examples/multibindings/BUILD b/examples/multibindings/BUILD
new file mode 100644
index 0000000..7497f09
--- /dev/null
+++ b/examples/multibindings/BUILD
@@ -0,0 +1,6 @@
+
+cc_binary(
+ name = "multibindings",
+ srcs = ["main.cpp"],
+ deps = ["//:fruit"],
+)
diff --git a/examples/scaling_doubles/BUILD b/examples/scaling_doubles/BUILD
new file mode 100644
index 0000000..90ca608
--- /dev/null
+++ b/examples/scaling_doubles/BUILD
@@ -0,0 +1,10 @@
+
+
+cc_binary(
+ name = "scaling_doubles",
+ srcs = glob([
+ "*.cpp",
+ "*.h",
+ ]),
+ deps = ["//:fruit"],
+)
diff --git a/examples/server/BUILD b/examples/server/BUILD
new file mode 100644
index 0000000..db18ec2
--- /dev/null
+++ b/examples/server/BUILD
@@ -0,0 +1,10 @@
+
+cc_binary(
+ name = "server",
+ srcs = glob([
+ "*.cpp",
+ "*.h",
+ ]),
+ linkopts = ["-pthread"],
+ deps = ["//:fruit"],
+)
diff --git a/examples/simple_injection/BUILD b/examples/simple_injection/BUILD
new file mode 100644
index 0000000..8f9ea9f
--- /dev/null
+++ b/examples/simple_injection/BUILD
@@ -0,0 +1,25 @@
+
+cc_library(
+ name = "simple_injection_lib",
+ srcs = glob(["*.cpp"], exclude = ["main*.cpp"]),
+ hdrs = glob(["*.h"]),
+ deps = ["//:fruit"],
+)
+
+cc_binary(
+ name = "simple_injection",
+ srcs = ["main.cpp"],
+ deps = [
+ ":simple_injection_lib",
+ "//:fruit",
+ ],
+)
+
+cc_binary(
+ name = "simple_injection_v1",
+ srcs = ["main_v1.cpp"],
+ deps = [
+ ":simple_injection_lib",
+ "//:fruit",
+ ],
+)