Config bazel for pw_bloaty and size_report.
Fill out pw_bloaty/BUILD and add pw_string/size_report/BUILD.
Change-Id: I5ff98de0a452491cdff595ad56ee7365f40590dd
diff --git a/pw_bloat/BUILD b/pw_bloat/BUILD
index 85a5ca0..c3de76a 100644
--- a/pw_bloat/BUILD
+++ b/pw_bloat/BUILD
@@ -15,3 +15,24 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
+
+load(
+ "//pw_build:pigweed.bzl",
+ "pw_cc_binary",
+ "pw_cc_library",
+)
+
+# Library which uses standard C/C++ functions such as memcpy to prevent them
+# from showing up within bloat diff reports.
+pw_cc_library(
+ name = "bloat_this_binary",
+ srcs = ["bloat_this_binary.cc"],
+ hdrs = ["public/pw_bloat/bloat_this_binary.h"],
+)
+
+# Standard minimal base binary for bloat reports.
+pw_cc_binary(
+ name = "bloat_base",
+ srcs = ["base_main.cc"],
+ deps = [":bloat_this_binary"],
+)
diff --git a/pw_string/size_report/BUILD b/pw_string/size_report/BUILD
new file mode 100644
index 0000000..7c6b474
--- /dev/null
+++ b/pw_string/size_report/BUILD
@@ -0,0 +1,154 @@
+# Copyright 2019 The Pigweed Authors
+#
+# 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.
+
+load(
+ "//pw_build:pigweed.bzl",
+ "pw_cc_binary",
+)
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"]) # Apache License 2.0
+
+pw_cc_binary(
+ name = "single_write_snprintf",
+ srcs = ["format_single.cc"],
+ copts = ["-DUSE_FORMAT=0"],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "single_write_format",
+ srcs = ["format_single.cc"],
+ copts = ["-DUSE_FORMAT=1"],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "multiple_writes_snprintf",
+ srcs = ["format_multiple.cc"],
+ copts = ["-DUSE_FORMAT=0"],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "multiple_writes_format",
+ srcs = ["format_multiple.cc"],
+ copts = ["-DUSE_FORMAT=1"],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "many_writes_snprintf",
+ srcs = ["format_many_without_error_handling.cc"],
+ copts = ["-DUSE_FORMAT=0"],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "many_writes_format",
+ srcs = ["format_many_without_error_handling.cc"],
+ copts = ["-DUSE_FORMAT=1"],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "build_string_with_snprintf_no_base_snprintf",
+ srcs = ["string_builder_size_report.cc"],
+ copts = [
+ "-DUSE_STRING_BUILDER=0",
+ "-DPROVIDE_BASE_SNPRINTF=0",
+ ],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "build_string_with_string_builder_no_base_snprintf",
+ srcs = ["string_builder_size_report.cc"],
+ copts = [
+ "-DUSE_STRING_BUILDER=1",
+ "-DPROVIDE_BASE_SNPRINTF=0",
+ ],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "build_string_with_snprintf",
+ srcs = ["string_builder_size_report.cc"],
+ copts = [
+ "-DUSE_STRING_BUILDER=0",
+ "-DPROVIDE_BASE_SNPRINTF=1",
+ ],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "build_string_with_string_builder",
+ srcs = ["string_builder_size_report.cc"],
+ copts = [
+ "-DUSE_STRING_BUILDER=1",
+ "-DPROVIDE_BASE_SNPRINTF=1",
+ ],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "build_string_incremental_with_snprintf",
+ srcs = ["string_builder_size_report_incremental.cc"],
+ copts = ["-DUSE_STRING_BUILDER=0"],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)
+
+pw_cc_binary(
+ name = "build_string_incremental_with_string_builder",
+ srcs = ["string_builder_size_report_incremental.cc"],
+ copts = ["-DUSE_STRING_BUILDER=1"],
+ deps = [
+ "//pw_bloat:bloat_this_binary",
+ "//pw_string",
+ ],
+)