Miao Wang | 359dcbe | 2020-02-10 15:10:04 -0800 | [diff] [blame] | 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 | |
Bob Badour | 71638c2 | 2021-02-12 14:52:16 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["external_cpuinfo_license"], |
| 17 | } |
| 18 | |
| 19 | // Added automatically by a large-scale-change |
| 20 | // See: http://go/android-license-faq |
| 21 | license { |
| 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 | |
Miao Wang | 359dcbe | 2020-02-10 15:10:04 -0800 | [diff] [blame] | 32 | cpuinfo_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 | |
| 44 | cpuinfo_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 | |
| 59 | cc_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", |
Miao Wang | 359dcbe | 2020-02-10 15:10:04 -0800 | [diff] [blame] | 71 | "src/linux/processors.c", |
| 72 | "src/linux/smallfile.c", |
| 73 | "src/linux/multiline.c", |
| 74 | "src/linux/cpulist.c", |
| 75 | ], |
| 76 | arch: { |
| 77 | arm: { |
| 78 | srcs: cpuinfo_arm_common_src_files + [ |
| 79 | "src/arm/linux/aarch32-isa.c", |
| 80 | ], |
| 81 | cflags: [ |
Miao Wang | edde61d | 2020-06-25 19:20:57 -0700 | [diff] [blame] | 82 | "-mcpu=generic", |
Miao Wang | 359dcbe | 2020-02-10 15:10:04 -0800 | [diff] [blame] | 83 | "-march=armv7-a", |
| 84 | ], |
| 85 | }, |
| 86 | arm64: { |
| 87 | srcs: cpuinfo_arm_common_src_files + [ |
| 88 | "src/arm/linux/aarch64-isa.c", |
| 89 | ], |
| 90 | }, |
| 91 | x86: { |
| 92 | srcs: cpuinfo_x86_common_src_files, |
| 93 | }, |
| 94 | x86_64: { |
| 95 | srcs: cpuinfo_x86_common_src_files, |
| 96 | }, |
| 97 | }, |
| 98 | cflags: [ |
| 99 | "-std=c99", |
| 100 | "-Oz", |
| 101 | "-D_GNU_SOURCE=1", |
| 102 | "-Wno-unused-function", |
| 103 | "-Wno-unused-parameter", |
| 104 | "-Wno-missing-field-initializers", |
| 105 | ], |
| 106 | whole_static_libs: [ |
| 107 | "libclog", |
| 108 | ], |
| 109 | } |