| # Copyright (C) 2026 The Android Open Source Project | |
| # | |
| # 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 | |
| # | |
| # http://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. | |
| import("../../../gn/perfetto_cc_proto_descriptor.gni") | |
| import("../../../gn/perfetto_host_executable.gni") | |
| import("../../../gn/test.gni") | |
| source_set("compiler") { | |
| sources = [ | |
| "compiler.cc", | |
| "compiler.h", | |
| "instruction_emitter.cc", | |
| "instruction_emitter.h", | |
| ] | |
| deps = [ | |
| ":gen_cc_compile_config_descriptor", | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/protozero", | |
| "../../../protos/perfetto/common:zero", | |
| "../../../protos/perfetto/protovm:compile_config_zero", | |
| "../../../protos/perfetto/protovm:zero", | |
| "../../base", | |
| "../../protozero", | |
| "../../protozero/text_to_proto", | |
| "../../trace_processor/util:descriptors", | |
| ] | |
| } | |
| perfetto_host_executable("protovm_compiler") { | |
| sources = [ "main.cc" ] | |
| deps = [ | |
| ":compiler", | |
| "../../../gn:default_deps", | |
| "../../../gn:protoc_lib", | |
| "../../base", | |
| "../../protozero:multifile_error_collector", | |
| ] | |
| } | |
| perfetto_cc_proto_descriptor("gen_cc_trace_descriptor") { | |
| descriptor_name = "trace.descriptor" | |
| descriptor_target = "../../../protos/perfetto/trace:descriptor" | |
| } | |
| perfetto_cc_proto_descriptor("gen_cc_android_extension_descriptor") { | |
| descriptor_name = "android_extension.descriptor" | |
| descriptor_target = "../../../protos/third_party/android:extension_descriptor" | |
| } | |
| perfetto_cc_proto_descriptor("gen_cc_compile_config_descriptor") { | |
| descriptor_name = "compile_config.descriptor" | |
| descriptor_target = | |
| "../../../protos/perfetto/protovm:compile_config_descriptor" | |
| } | |
| perfetto_cc_proto_descriptor("gen_cc_vm_program_descriptor") { | |
| descriptor_name = "vm_program.descriptor" | |
| descriptor_target = "../../../protos/perfetto/protovm:descriptor" | |
| } | |
| perfetto_unittest_source_set("unittests") { | |
| testonly = true | |
| deps = [ | |
| ":compiler", | |
| ":gen_cc_android_extension_descriptor", | |
| ":gen_cc_trace_descriptor", | |
| ":gen_cc_vm_program_descriptor", | |
| "../../../gn:default_deps", | |
| "../../../gn:gtest_and_gmock", | |
| "../../protozero/text_to_proto", | |
| "../../trace_processor/util:descriptors", | |
| "../../trace_processor/util:protozero_to_text", | |
| ] | |
| cflags = [ "-Wno-deprecated-redundant-constexpr-static-def" ] | |
| sources = [ "compiler_unittest.cc" ] | |
| } |