Build changes to support other embedders other than chromium
The embedder is supposed to:
1) Set perfetto_build_with_embedder = true in its
build_overrides/build.gni
2) Define protobuf targets and have a proto_library.gni
that is API compatible with perfetto or chromium ones.
3) Set perfetto_protobuf_target_prefix to the GN path
that contains the proto targets.
This change:
- Introduces a perfetto_build_with_embedder bool.
- Rename build_with_android -> perfetto_build_with_android
- Rename build_standalone -> perfetto_build_standalone
Change-Id: Ib8f4ab5be494c591e980158c1d2ea018b0f6298b
diff --git a/gn/proto_library.gni b/gn/proto_library.gni
index 3ccdeab..a34419d 100644
--- a/gn/proto_library.gni
+++ b/gn/proto_library.gni
@@ -12,10 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import("//build_overrides/build.gni")
+import("perfetto.gni")
-if (!build_with_chromium) {
- import("//gn/standalone/proto_library.gni")
-} else {
- import("//third_party/protobuf/proto_library.gni")
+if (!defined(perfetto_protobuf_target_prefix)) {
+ if (perfetto_build_standalone || perfetto_build_with_android) {
+ perfetto_protobuf_target_prefix = "//buildtools"
+ } else {
+ perfetto_protobuf_target_prefix = "//third_party/protobuf"
+ }
}
+
+if (!defined(perfetto_protobuf_gni)) {
+ if (perfetto_build_standalone || perfetto_build_with_android) {
+ perfetto_protobuf_gni = "//gn/standalone/proto_library.gni"
+ } else {
+ perfetto_protobuf_gni = "//third_party/protobuf/proto_library.gni"
+ }
+}
+
+import(perfetto_protobuf_gni)