blob: 8ff32b7a9c61da82bb372808a7e66b850a949a6d [file] [log] [blame]
Miao Wang359dcbe2020-02-10 15:10:04 -08001// 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
15cpuinfo_arm_common_src_files = [
16 "src/arm/uarch.c",
17 "src/arm/cache.c",
18 "src/arm/linux/init.c",
19 "src/arm/linux/cpuinfo.c",
20 "src/arm/linux/clusters.c",
21 "src/arm/linux/chipset.c",
22 "src/arm/linux/midr.c",
23 "src/arm/linux/hwcap.c",
24 "src/arm/android/properties.c",
25]
26
27cpuinfo_x86_common_src_files = [
28 "src/x86/init.c",
29 "src/x86/info.c",
30 "src/x86/name.c",
31 "src/x86/isa.c",
32 "src/x86/vendor.c",
33 "src/x86/uarch.c",
34 "src/x86/topology.c",
35 "src/x86/cache/init.c",
36 "src/x86/cache/descriptor.c",
37 "src/x86/cache/deterministic.c",
38 "src/x86/linux/cpuinfo.c",
39 "src/x86/linux/init.c",
40]
41
42cc_library_static {
43 name: "libcpuinfo",
44 export_include_dirs: ["include"],
45 vendor_available: true,
46 sdk_version: "current",
47 local_include_dirs: [
48 "src",
49 ],
50 srcs: [
51 "src/init.c",
52 "src/api.c",
53 "src/cache.c",
Miao Wang359dcbe2020-02-10 15:10:04 -080054 "src/linux/processors.c",
55 "src/linux/smallfile.c",
56 "src/linux/multiline.c",
57 "src/linux/cpulist.c",
58 ],
59 arch: {
60 arm: {
61 srcs: cpuinfo_arm_common_src_files + [
62 "src/arm/linux/aarch32-isa.c",
63 ],
64 cflags: [
65 "-march=armv7-a",
66 ],
67 },
68 arm64: {
69 srcs: cpuinfo_arm_common_src_files + [
70 "src/arm/linux/aarch64-isa.c",
71 ],
72 },
73 x86: {
74 srcs: cpuinfo_x86_common_src_files,
75 },
76 x86_64: {
77 srcs: cpuinfo_x86_common_src_files,
78 },
79 },
80 cflags: [
81 "-std=c99",
82 "-Oz",
83 "-D_GNU_SOURCE=1",
84 "-Wno-unused-function",
85 "-Wno-unused-parameter",
86 "-Wno-missing-field-initializers",
87 ],
88 whole_static_libs: [
89 "libclog",
90 ],
91}