diff options
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-02-12 02:18:32 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-02-12 02:18:32 +0000 |
commit | 4b386ba1ff55e0eb614f0d1d0d56c2a0b84af225 (patch) | |
tree | 40629e3896de16ea7dfb800a415d7a1422baa154 | |
parent | 755a000d52572aaad3388c981bc361b706e6774f (diff) | |
parent | 359dcbee06b072d63378095862f5bc2a2d0ce775 (diff) | |
download | cpuinfo-4b386ba1ff55e0eb614f0d1d0d56c2a0b84af225.tar.gz |
Add build files and meta data files am: 359dcbee06
Change-Id: I76b3be786d73e353fb043d787596a83a282fdb8e
-rw-r--r-- | Android.bp | 92 | ||||
-rw-r--r-- | METADATA | 18 | ||||
-rw-r--r-- | MODULE_LICENSE_BSD | 0 | ||||
l--------- | NOTICE | 1 | ||||
-rw-r--r-- | deps/clog/Android.bp | 30 | ||||
-rw-r--r-- | deps/clog/jni/Android.mk | 17 | ||||
-rw-r--r-- | deps/clog/jni/Application.mk | 3 | ||||
-rw-r--r-- | jni/Android.mk | 70 | ||||
-rw-r--r-- | jni/Application.mk | 4 |
9 files changed, 141 insertions, 94 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..0503e9c --- /dev/null +++ b/Android.bp @@ -0,0 +1,92 @@ +// Copyright (C) 2020 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. + +cpuinfo_arm_common_src_files = [ + "src/arm/uarch.c", + "src/arm/cache.c", + "src/arm/linux/init.c", + "src/arm/linux/cpuinfo.c", + "src/arm/linux/clusters.c", + "src/arm/linux/chipset.c", + "src/arm/linux/midr.c", + "src/arm/linux/hwcap.c", + "src/arm/android/properties.c", +] + +cpuinfo_x86_common_src_files = [ + "src/x86/init.c", + "src/x86/info.c", + "src/x86/name.c", + "src/x86/isa.c", + "src/x86/vendor.c", + "src/x86/uarch.c", + "src/x86/topology.c", + "src/x86/cache/init.c", + "src/x86/cache/descriptor.c", + "src/x86/cache/deterministic.c", + "src/x86/linux/cpuinfo.c", + "src/x86/linux/init.c", +] + +cc_library_static { + name: "libcpuinfo", + export_include_dirs: ["include"], + vendor_available: true, + sdk_version: "current", + local_include_dirs: [ + "src", + ], + srcs: [ + "src/init.c", + "src/api.c", + "src/cache.c", + "src/linux/current.c", + "src/linux/processors.c", + "src/linux/smallfile.c", + "src/linux/multiline.c", + "src/linux/cpulist.c", + ], + arch: { + arm: { + srcs: cpuinfo_arm_common_src_files + [ + "src/arm/linux/aarch32-isa.c", + ], + cflags: [ + "-march=armv7-a", + ], + }, + arm64: { + srcs: cpuinfo_arm_common_src_files + [ + "src/arm/linux/aarch64-isa.c", + ], + }, + x86: { + srcs: cpuinfo_x86_common_src_files, + }, + x86_64: { + srcs: cpuinfo_x86_common_src_files, + }, + }, + cflags: [ + "-std=c99", + "-Oz", + "-D_GNU_SOURCE=1", + "-Wno-unused-function", + "-Wno-unused-parameter", + "-Wno-missing-field-initializers", + ], + whole_static_libs: [ + "libclog", + ], +} diff --git a/METADATA b/METADATA new file mode 100644 index 0000000..e85d587 --- /dev/null +++ b/METADATA @@ -0,0 +1,18 @@ +name: "cpuinfo" +description: + "cpuinfo is a library to detect essential for performance optimization " + "information about host CPU." + +third_party { + url { + type: HOMEPAGE + value: "https://github.com/pytorch/cpuinfo" + } + url { + type: GIT + value: "https://github.com/pytorch/cpuinfo" + } + version: "e39a5790059b6b8274ed91f7b5b5b13641dff267" + last_upgrade_date { year: 2020 month: 2 day: 3 } + license_type: NOTICE +} diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/MODULE_LICENSE_BSD @@ -0,0 +1 @@ +LICENSE
\ No newline at end of file diff --git a/deps/clog/Android.bp b/deps/clog/Android.bp new file mode 100644 index 0000000..31cab00 --- /dev/null +++ b/deps/clog/Android.bp @@ -0,0 +1,30 @@ +// Copyright (C) 2020 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. + +cc_library_static { + name: "libclog", + export_include_dirs: ["include"], + vendor_available: true, + sdk_version: "current", + srcs: [ + "src/clog.c", + ], + cflags: [ + "-std=c99", + "-Oz", + ], + shared_libs: [ + "liblog", + ] +} diff --git a/deps/clog/jni/Android.mk b/deps/clog/jni/Android.mk deleted file mode 100644 index f7afb6d..0000000 --- a/deps/clog/jni/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH := $(call my-dir)/.. - -include $(CLEAR_VARS) -LOCAL_MODULE := clog -LOCAL_SRC_FILES := src/clog.c -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include -LOCAL_C_INCLUDES := $(LOCAL_EXPORT_C_INCLUDES) -LOCAL_CFLAGS := -std=c99 -Wall -ifeq (,$(findstring 4.9,$(NDK_TOOLCHAIN))) -# Clang compiler supports -Oz -LOCAL_CFLAGS += -Oz -else -# gcc-4.9 compiler supports only -Os -LOCAL_CFLAGS += -Os -endif -LOCAL_EXPORT_LDLIBS := -llog -include $(BUILD_STATIC_LIBRARY) diff --git a/deps/clog/jni/Application.mk b/deps/clog/jni/Application.mk deleted file mode 100644 index 27c8015..0000000 --- a/deps/clog/jni/Application.mk +++ /dev/null @@ -1,3 +0,0 @@ -APP_PLATFORM := android-15 -APP_PIE := true -APP_ABI := all diff --git a/jni/Android.mk b/jni/Android.mk deleted file mode 100644 index c289df6..0000000 --- a/jni/Android.mk +++ /dev/null @@ -1,70 +0,0 @@ -LOCAL_PATH := $(call my-dir)/.. - -include $(CLEAR_VARS) -LOCAL_MODULE := cpuinfo -LOCAL_SRC_FILES := \ - src/init.c \ - src/api.c \ - src/linux/current.c \ - src/linux/processors.c \ - src/linux/smallfile.c \ - src/linux/multiline.c \ - src/linux/cpulist.c -ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI),armeabi armeabi-v7a arm64-v8a)) -LOCAL_SRC_FILES += \ - src/arm/uarch.c \ - src/arm/cache.c \ - src/arm/linux/init.c \ - src/arm/linux/cpuinfo.c \ - src/arm/linux/clusters.c \ - src/arm/linux/chipset.c \ - src/arm/linux/midr.c \ - src/arm/linux/hwcap.c \ - src/arm/android/properties.c -ifeq ($(TARGET_ARCH_ABI),armeabi) -LOCAL_SRC_FILES += src/arm/linux/aarch32-isa.c.arm -endif # armeabi -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) -LOCAL_SRC_FILES += src/arm/linux/aarch32-isa.c -endif # armeabi-v7a -ifeq ($(TARGET_ARCH_ABI),arm64-v8a) -LOCAL_SRC_FILES += src/arm/linux/aarch64-isa.c -endif # arm64-v8a -endif # armeabi, armeabi-v7a, or arm64-v8a -ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI),x86 x86_64)) -LOCAL_SRC_FILES += \ - src/x86/init.c \ - src/x86/info.c \ - src/x86/name.c \ - src/x86/isa.c \ - src/x86/vendor.c \ - src/x86/uarch.c \ - src/x86/topology.c \ - src/x86/cache/init.c \ - src/x86/cache/descriptor.c \ - src/x86/cache/deterministic.c \ - src/x86/linux/cpuinfo.c \ - src/x86/linux/init.c -endif # x86 or x86_64 -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include -LOCAL_C_INCLUDES := $(LOCAL_EXPORT_C_INCLUDES) $(LOCAL_PATH)/src -LOCAL_CFLAGS := -std=c99 -Wall -D_GNU_SOURCE=1 -ifeq (,$(findstring 4.9,$(NDK_TOOLCHAIN))) -# Clang compiler supports -Oz -LOCAL_CFLAGS += -Oz -else -# gcc-4.9 compiler supports only -Os -LOCAL_CFLAGS += -Os -endif -ifeq ($(NDK_DEBUG),1) -LOCAL_CFLAGS += -DCPUINFO_LOG_LEVEL=5 -else -LOCAL_CFLAGS += -DCPUINFO_LOG_LEVEL=0 -endif -LOCAL_STATIC_LIBRARIES := clog -include $(BUILD_STATIC_LIBRARY) - - -$(call import-add-path,$(LOCAL_PATH)/deps) - -$(call import-module,clog/jni) diff --git a/jni/Application.mk b/jni/Application.mk deleted file mode 100644 index 3667da3..0000000 --- a/jni/Application.mk +++ /dev/null @@ -1,4 +0,0 @@ -APP_PLATFORM := android-15 -APP_PIE := true -APP_STL := c++_static -APP_ABI := armeabi armeabi-v7a arm64-v8a x86 x86_64 |