• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["external_cpuinfo_license"],
17}
18
19// Added automatically by a large-scale-change
20// See: http://go/android-license-faq
21license {
22    name: "external_cpuinfo_license",
23    visibility: [":__subpackages__"],
24    license_kinds: [
25        "SPDX-license-identifier-BSD",
26    ],
27    license_text: [
28        "LICENSE",
29    ],
30}
31
32cpuinfo_arm_common_src_files = [
33    "src/arm/uarch.c",
34    "src/arm/cache.c",
35    "src/arm/linux/init.c",
36    "src/arm/linux/cpuinfo.c",
37    "src/arm/linux/clusters.c",
38    "src/arm/linux/chipset.c",
39    "src/arm/linux/midr.c",
40    "src/arm/linux/hwcap.c",
41    "src/arm/android/properties.c",
42]
43
44cpuinfo_x86_common_src_files = [
45    "src/x86/init.c",
46    "src/x86/info.c",
47    "src/x86/name.c",
48    "src/x86/isa.c",
49    "src/x86/vendor.c",
50    "src/x86/uarch.c",
51    "src/x86/topology.c",
52    "src/x86/cache/init.c",
53    "src/x86/cache/descriptor.c",
54    "src/x86/cache/deterministic.c",
55    "src/x86/linux/cpuinfo.c",
56    "src/x86/linux/init.c",
57]
58
59cc_library_static {
60    name: "libcpuinfo",
61    export_include_dirs: ["include"],
62    vendor_available: true,
63    sdk_version: "current",
64    local_include_dirs: [
65        "src",
66    ],
67    srcs: [
68        "src/init.c",
69        "src/api.c",
70        "src/cache.c",
71        "src/log.c",
72        "src/linux/processors.c",
73        "src/linux/smallfile.c",
74        "src/linux/multiline.c",
75        "src/linux/cpulist.c",
76    ],
77    arch: {
78        arm: {
79            srcs: cpuinfo_arm_common_src_files + [
80                "src/arm/linux/aarch32-isa.c",
81            ],
82       },
83        arm64: {
84            srcs: cpuinfo_arm_common_src_files + [
85                "src/arm/linux/aarch64-isa.c",
86            ],
87        },
88        riscv64: {
89            srcs: [
90                "src/riscv/linux/init.c",
91                "src/riscv/linux/riscv-hw.c",
92                "src/riscv/linux/riscv-isa.c",
93                "src/riscv/uarch.c",
94            ],
95        },
96        x86: {
97            srcs: cpuinfo_x86_common_src_files,
98        },
99        x86_64: {
100            srcs: cpuinfo_x86_common_src_files,
101        },
102    },
103    cflags: [
104        "-std=c99",
105        "-Oz",
106        "-D_GNU_SOURCE=1",
107        "-Wno-unused-function",
108        "-Wno-unused-parameter",
109        "-Wno-missing-field-initializers",
110        "-DCPUINFO_LOG_LEVEL=2",
111    ],
112    whole_static_libs: [
113        "libclog",
114    ],
115    shared_libs: [
116        "liblog",
117    ],
118}
119