// Copyright (C) 2022 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.
//
// This file is automatically generated by gen_android_bp.py. Do not edit.

// GN: Package-Artificial
package {
    default_applicable_licenses: [
        "stable_cronet_third_party_perfetto_license",
    ],
}

// GN: //third_party/perfetto/src/tracing/service:service
cc_library_static {
    name: "stable_cronet_third_party_perfetto_src_tracing_service_service",
    srcs: [
        "clock.cc",
        "metatrace_writer.cc",
        "packet_stream_validator.cc",
        "random.cc",
        "trace_buffer.cc",
        "tracing_service_impl.cc",
    ],
    shared_libs: [
        "liblog",
    ],
    host_cross_supported: false,
    generated_headers: [
        "stable_cronet_third_party_perfetto_src_tracing_service_service__concatenated_headers_common",
    ],
    defaults: [
        "stable_cronet_cc_defaults",
    ],
    cflags: [
        "-DANDROID",
        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
        "-DHAVE_SYS_UIO_H",
        "-DNDEBUG",
        "-DNVALGRIND",
        "-DOFFICIAL_BUILD",
        "-DPERFETTO_IMPLEMENTATION",
        "-D_GNU_SOURCE",
        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
        "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
        "-D_LIBCPP_INSTRUMENTED_WITH_ASAN=0",
        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
        "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
        "-D__STDC_CONSTANT_MACROS",
        "-D__STDC_FORMAT_MACROS",
        "-fdata-sections",
        "-ffunction-sections",
        "-fstack-protector",
        "-fvisibility-inlines-hidden",
        "-fvisibility=hidden",
        "-g1",
    ],
    include_dirs: [
        "external/cronet/stable/",
        "external/cronet/stable/buildtools/third_party/libc++/",
        "external/cronet/stable/third_party/libc++/src/include",
        "external/cronet/stable/third_party/libc++abi/src/include",
        "external/cronet/stable/third_party/perfetto/",
        "external/cronet/stable/third_party/perfetto/include/",
        "external/cronet/stable/third_party/perfetto/src/profiling/memory/include/",
        "external/cronet/stable/third_party/protobuf/src/",
    ],
    cpp_std: "c++20",
    ldflags: [
        "-Wl,--as-needed",
        "-Wl,--gc-sections",
        "-Wl,--icf=all",
    ],
    visibility: [
        "//external/cronet:__subpackages__",
    ],
    target: {
        android_arm: {
            cflags: [
                "-D_FORTIFY_SOURCE=2",
            ],
        },
        android_arm64: {
            cflags: [
                "-D_FORTIFY_SOURCE=2",
                "-D__ARM_NEON__=1",
                "-O2",
                "-mno-outline",
            ],
        },
        android_x86: {
            cflags: [
                "-D_FORTIFY_SOURCE=2",
                "-msse3",
            ],
        },
        android_x86_64: {
            cflags: [
                "-D_FORTIFY_SOURCE=2",
                "-O2",
                "-msse3",
            ],
        },
    },
}

// GN: //third_party/perfetto/src/tracing/service:service__testing
cc_library_static {
    name: "stable_cronet_third_party_perfetto_src_tracing_service_service__testing",
    srcs: [
        "clock.cc",
        "metatrace_writer.cc",
        "packet_stream_validator.cc",
        "random.cc",
        "trace_buffer.cc",
        "tracing_service_impl.cc",
    ],
    host_supported: true,
    host_cross_supported: false,
    generated_headers: [
        "stable_cronet_third_party_perfetto_src_tracing_service_service__testing__concatenated_headers_common",
    ],
    defaults: [
        "stable_cronet_cc_defaults",
    ],
    cflags: [
        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
        "-DNDEBUG",
        "-DNVALGRIND",
        "-DOFFICIAL_BUILD",
        "-DPERFETTO_IMPLEMENTATION",
        "-D_GNU_SOURCE",
        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
        "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
        "-D_LIBCPP_INSTRUMENTED_WITH_ASAN=0",
        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
        "-D__STDC_CONSTANT_MACROS",
        "-D__STDC_FORMAT_MACROS",
        "-fdata-sections",
        "-ffunction-sections",
        "-fstack-protector",
        "-fvisibility-inlines-hidden",
        "-fvisibility=hidden",
        "-g1",
    ],
    include_dirs: [
        "external/cronet/stable/",
        "external/cronet/stable/buildtools/third_party/libc++/",
        "external/cronet/stable/third_party/libc++/src/include",
        "external/cronet/stable/third_party/libc++abi/src/include",
        "external/cronet/stable/third_party/perfetto/",
        "external/cronet/stable/third_party/perfetto/include/",
        "external/cronet/stable/third_party/perfetto/src/profiling/memory/include/",
        "external/cronet/stable/third_party/protobuf/src/",
    ],
    cpp_std: "c++20",
    ldflags: [
        "-Wl,--as-needed",
        "-Wl,--gc-sections",
        "-Wl,--icf=all",
    ],
    visibility: [
        "//external/cronet:__subpackages__",
    ],
    target: {
        android_arm: {
            shared_libs: [
                "liblog",
            ],
            cflags: [
                "-DANDROID",
                "-DHAVE_SYS_UIO_H",
                "-D_FORTIFY_SOURCE=2",
                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
            ],
        },
        android_arm64: {
            shared_libs: [
                "liblog",
            ],
            cflags: [
                "-DANDROID",
                "-DHAVE_SYS_UIO_H",
                "-D_FORTIFY_SOURCE=2",
                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
                "-D__ARM_NEON__=1",
                "-O2",
                "-mno-outline",
            ],
        },
        android_riscv64: {
            shared_libs: [
                "liblog",
            ],
            cflags: [
                "-DANDROID",
                "-DHAVE_SYS_UIO_H",
                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
            ],
        },
        android_x86: {
            shared_libs: [
                "liblog",
            ],
            cflags: [
                "-DANDROID",
                "-DHAVE_SYS_UIO_H",
                "-D_FORTIFY_SOURCE=2",
                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
                "-msse3",
            ],
        },
        android_x86_64: {
            shared_libs: [
                "liblog",
            ],
            cflags: [
                "-DANDROID",
                "-DHAVE_SYS_UIO_H",
                "-D_FORTIFY_SOURCE=2",
                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
                "-O2",
                "-msse3",
            ],
        },
        host: {
            cflags: [
                "-DCR_SYSROOT_KEY=20250129T203412Z-1",
                "-DNO_UNWIND_TABLES",
                "-DUSE_AURA=1",
                "-DUSE_OZONE=1",
                "-DUSE_UDEV",
                "-D_FILE_OFFSET_BITS=64",
                "-D_FORTIFY_SOURCE=2",
                "-D_LARGEFILE64_SOURCE",
                "-D_LARGEFILE_SOURCE",
                "-O2",
                "-fno-asynchronous-unwind-tables",
                "-fno-unwind-tables",
                "-msse3",
            ],
            generated_headers: [
                "stable_cronet_third_party_perfetto_src_tracing_service_service__testing__concatenated_headers_host",
            ],
        },
    },
}
