summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-01-03 23:01:57 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-01-03 23:01:57 +0000
commit60a7eaee1fc4dda9c90ab21ab91c8c9e7ccce3a2 (patch)
treef9c0adb34be6581caa278326009a0240a11c98e5
parentef27273df8cad09f5de7dfe5ee4d293402c37572 (diff)
parent4695d7739b29602883cc55f6a4f6ebd69f663903 (diff)
downloadspirv-llvm-oreo-r6-release.tar.gz
Convert spirv-llvm to Android.bp am: e43b16aba2 am: e97cd2f133 am: 75fe812d3dandroid-vts-8.0_r9android-vts-8.0_r8android-vts-8.0_r7android-vts-8.0_r6android-vts-8.0_r2android-vts-8.0_r13android-vts-8.0_r12android-vts-8.0_r11android-vts-8.0_r10android-vts-8.0_r1android-security-8.0.0_r54android-security-8.0.0_r53android-security-8.0.0_r52android-cts-8.0_r9android-cts-8.0_r8android-cts-8.0_r7android-cts-8.0_r6android-cts-8.0_r5android-cts-8.0_r4android-cts-8.0_r3android-cts-8.0_r26android-cts-8.0_r25android-cts-8.0_r24android-cts-8.0_r23android-cts-8.0_r22android-cts-8.0_r21android-cts-8.0_r20android-cts-8.0_r2android-cts-8.0_r19android-cts-8.0_r18android-cts-8.0_r17android-cts-8.0_r16android-cts-8.0_r15android-cts-8.0_r14android-cts-8.0_r13android-cts-8.0_r12android-cts-8.0_r11android-cts-8.0_r10android-cts-8.0_r1android-8.0.0_r9android-8.0.0_r7android-8.0.0_r51android-8.0.0_r50android-8.0.0_r49android-8.0.0_r48android-8.0.0_r47android-8.0.0_r46android-8.0.0_r45android-8.0.0_r44android-8.0.0_r43android-8.0.0_r42android-8.0.0_r41android-8.0.0_r40android-8.0.0_r4android-8.0.0_r39android-8.0.0_r38android-8.0.0_r37android-8.0.0_r36android-8.0.0_r35android-8.0.0_r32android-8.0.0_r31android-8.0.0_r30android-8.0.0_r3android-8.0.0_r29android-8.0.0_r28android-8.0.0_r2android-8.0.0_r17android-8.0.0_r16android-8.0.0_r15android-8.0.0_r13android-8.0.0_r12android-8.0.0_r11android-8.0.0_r10android-8.0.0_r1security-oc-releaseoreo-vts-releaseoreo-security-releaseoreo-releaseoreo-r6-releaseoreo-r5-releaseoreo-r4-releaseoreo-r3-releaseoreo-r2-releaseoreo-devoreo-cts-release
am: 4695d7739b Change-Id: Iea06df2ca42ac6f6816f77a9cbe26c191804aa08
-rw-r--r--Android.bp4
-rw-r--r--Android.mk7
-rw-r--r--lib/Android.mk7
-rw-r--r--lib/SPIRV/Android.bp110
-rw-r--r--lib/SPIRV/Android.mk158
-rw-r--r--tools/Android.mk7
-rw-r--r--tools/llvm-spirv/Android.bp76
-rw-r--r--tools/llvm-spirv/Android.mk119
8 files changed, 190 insertions, 298 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 00000000..7866be1d
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,4 @@
+subdirs = [
+ "lib/SPIRV",
+ "tools/llvm-spirv",
+]
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 933e54f7..00000000
--- a/Android.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-#=====================================================================
-# Include Subdirectories
-#=====================================================================
-
-LOCAL_PATH:=$(call my-dir)
-
-include $(call all-makefiles-under,$(LOCAL_PATH)) \ No newline at end of file
diff --git a/lib/Android.mk b/lib/Android.mk
deleted file mode 100644
index 933e54f7..00000000
--- a/lib/Android.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-#=====================================================================
-# Include Subdirectories
-#=====================================================================
-
-LOCAL_PATH:=$(call my-dir)
-
-include $(call all-makefiles-under,$(LOCAL_PATH)) \ No newline at end of file
diff --git a/lib/SPIRV/Android.bp b/lib/SPIRV/Android.bp
new file mode 100644
index 00000000..7936dab3
--- /dev/null
+++ b/lib/SPIRV/Android.bp
@@ -0,0 +1,110 @@
+//
+// Copyright (C) 2016 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.
+//
+
+
+//=====================================================================
+// Shared Library libSPIRV
+//=====================================================================
+
+cc_library_shared {
+ name: "libSPIRV",
+ host_supported: true,
+
+ srcs: [
+ "libSPIRV/SPIRVBasicBlock.cpp",
+ "libSPIRV/SPIRVDebug.cpp",
+ "libSPIRV/SPIRVDecorate.cpp",
+ "libSPIRV/SPIRVEntry.cpp",
+ "libSPIRV/SPIRVFunction.cpp",
+ "libSPIRV/SPIRVInstruction.cpp",
+ "libSPIRV/SPIRVModule.cpp",
+ "libSPIRV/SPIRVStream.cpp",
+ "libSPIRV/SPIRVType.cpp",
+ "libSPIRV/SPIRVValue.cpp",
+ "Mangler/FunctionDescriptor.cpp",
+ "Mangler/Mangler.cpp",
+ "Mangler/ManglingUtils.cpp",
+ "Mangler/ParameterType.cpp",
+ "OCL20To12.cpp",
+ "OCL20ToSPIRV.cpp",
+ "OCL21ToSPIRV.cpp",
+ "OCLTypeToSPIRV.cpp",
+ "OCLUtil.cpp",
+ "SPIRVLowerBool.cpp",
+ "SPIRVLowerConstExpr.cpp",
+ "SPIRVLowerOCLBlocks.cpp",
+ "SPIRVReader.cpp",
+ "SPIRVRegularizeLLVM.cpp",
+ "SPIRVToOCL20.cpp",
+ "SPIRVUtil.cpp",
+ "SPIRVWriter.cpp",
+ "SPIRVWriterPass.cpp",
+ "TransOCLMD.cpp",
+ ],
+
+ export_include_dirs: [
+ ".",
+ "libSPIRV",
+ "Mangler",
+ ],
+
+ header_libs: ["llvm-headers"],
+
+ compile_multilib: "first",
+
+ target: {
+ android: {
+ cflags: ["-Wno-error=non-virtual-dtor"],
+ },
+ host: {
+ cflags: [
+ "-fno-rtti",
+ "-fno-exceptions",
+ ],
+ },
+ linux: {
+ host_ldlibs: [
+ "-lrt",
+ "-ldl",
+ "-lpthread",
+ ],
+ },
+ darwin: {
+ host_ldlibs: [
+ "-ldl",
+ "-lpthread",
+ ],
+ },
+ },
+
+ shared_libs: ["libLLVM"],
+
+ cflags: [
+ "-D_SPIRV_LLVM_API",
+ "-D__STDC_LIMIT_MACROS",
+ "-D__STDC_CONSTANT_MACROS",
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
+
+ product_variables: {
+ unbundled_build: {
+ // Don't build for unbundled branches
+ enabled: false,
+ },
+ },
+}
diff --git a/lib/SPIRV/Android.mk b/lib/SPIRV/Android.mk
deleted file mode 100644
index 65b74378..00000000
--- a/lib/SPIRV/Android.mk
+++ /dev/null
@@ -1,158 +0,0 @@
-#
-# Copyright (C) 2016 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-LIBSPIRV_ROOT_PATH := $(LOCAL_PATH)
-LLVM_ROOT := external/llvm
-
-FORCE_BUILD_LLVM_DISABLE_NDEBUG ?= false
-# Legality check: FORCE_BUILD_LLVM_DISABLE_NDEBUG should consist of
-# one word -- either "true" or "false".
-ifneq "$(words $(FORCE_BUILD_LLVM_DISABLE_NDEBUG))$(words $(filter-out true \
- false,$(FORCE_BUILD_LLVM_DISABLE_NDEBUG)))" "10"
- $(error FORCE_BUILD_LLVM_DISABLE_NDEBUG may only be true, false, or unset)
-endif
-
-FORCE_BUILD_LLVM_DEBUG ?= false
-# Legality check: FORCE_BUILD_LLVM_DEBUG should consist of
-# one word -- either "true" or "false".
-ifneq "$(words $(FORCE_BUILD_LLVM_DEBUG))$(words $(filter-out true \
- false,$(FORCE_BUILD_LLVM_DEBUG)))" "10"
- $(error FORCE_BUILD_LLVM_DEBUG may only be true, false, or unset)
-endif
-
-SPIRV_SOURCES:= \
- libSPIRV/SPIRVBasicBlock.cpp \
- libSPIRV/SPIRVDebug.cpp \
- libSPIRV/SPIRVDecorate.cpp \
- libSPIRV/SPIRVEntry.cpp \
- libSPIRV/SPIRVFunction.cpp \
- libSPIRV/SPIRVInstruction.cpp \
- libSPIRV/SPIRVModule.cpp \
- libSPIRV/SPIRVStream.cpp \
- libSPIRV/SPIRVType.cpp \
- libSPIRV/SPIRVValue.cpp \
- Mangler/FunctionDescriptor.cpp \
- Mangler/Mangler.cpp \
- Mangler/ManglingUtils.cpp \
- Mangler/ParameterType.cpp \
- OCL20To12.cpp \
- OCL20ToSPIRV.cpp \
- OCL21ToSPIRV.cpp \
- OCLTypeToSPIRV.cpp \
- OCLUtil.cpp \
- SPIRVLowerBool.cpp \
- SPIRVLowerConstExpr.cpp \
- SPIRVLowerOCLBlocks.cpp \
- SPIRVReader.cpp \
- SPIRVRegularizeLLVM.cpp \
- SPIRVToOCL20.cpp \
- SPIRVUtil.cpp \
- SPIRVWriter.cpp \
- SPIRVWriterPass.cpp \
- TransOCLMD.cpp
-
-#=====================================================================
-# Host Shared Library libSPIRV
-#=====================================================================
-
-# Don't build for unbundled branches
-ifeq (,$(TARGET_BUILD_APPS))
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- $(SPIRV_SOURCES)
-
-LOCAL_C_INCLUDES := \
- $(LIBSPIRV_ROOT_PATH)/Mangler \
- $(LIBSPIRV_ROOT_PATH)/libSPIRV \
- $(LLVM_ROOT)/include \
- $(LLVM_ROOT)/host/include
-
-LOCAL_MODULE := libSPIRV
-
-# TODO: test windows build
-
-LOCAL_MODULE_HOST_OS := linux darwin
-LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MULTILIB := first
-
-LOCAL_LDLIBS_linux := -lrt -ldl -ltinfo -lpthread
-LOCAL_LDLIBS_darwin := -ldl -lpthread
-
-LOCAL_SHARED_LIBRARIES += libLLVM
-
-LOCAL_CFLAGS += $(TOOL_CFLAGS) \
- -D_SPIRV_LLVM_API \
- -D__STDC_LIMIT_MACROS \
- -Wno-error=pessimizing-move \
- -Wno-error=unused-variable \
- -Wno-error=unused-private-field \
- -Wno-error=unused-function \
- -Wno-error=dangling-else \
- -Wno-error=ignored-qualifiers
-
-include $(LLVM_ROOT)/llvm.mk
-include $(LLVM_GEN_INTRINSICS_MK)
-include $(LLVM_GEN_ATTRIBUTES_MK)
-include $(LLVM_HOST_BUILD_MK)
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-endif # Don't build in unbundled branches
-
-#=====================================================================
-# Device Shared Library libSPIRV
-#=====================================================================
-ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libSPIRV
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-
-LOCAL_SHARED_LIBRARIES := libLLVM
-
-LOCAL_SRC_FILES := \
- $(SPIRV_SOURCES)
-
-LOCAL_C_INCLUDES := \
- $(LIBSPIRV_ROOT_PATH)/Mangler \
- $(LIBSPIRV_ROOT_PATH)/libSPIRV
-
-LOCAL_CFLAGS += $(TOOL_CFLAGS) \
- -D_SPIRV_LLVM_API \
- -Wno-error=pessimizing-move \
- -Wno-error=unused-variable \
- -Wno-error=unused-private-field \
- -Wno-error=unused-function \
- -Wno-error=dangling-else \
- -Wno-error=ignored-qualifiers \
- -Wno-error=non-virtual-dtor
-
-include $(LLVM_GEN_INTRINSICS_MK)
-include $(LLVM_GEN_ATTRIBUTES_MK)
-include $(LLVM_DEVICE_BUILD_MK)
-include $(BUILD_SHARED_LIBRARY)
-endif
-
-#=====================================================================
-# Include Subdirectories
-#=====================================================================
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
diff --git a/tools/Android.mk b/tools/Android.mk
deleted file mode 100644
index 933e54f7..00000000
--- a/tools/Android.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-#=====================================================================
-# Include Subdirectories
-#=====================================================================
-
-LOCAL_PATH:=$(call my-dir)
-
-include $(call all-makefiles-under,$(LOCAL_PATH)) \ No newline at end of file
diff --git a/tools/llvm-spirv/Android.bp b/tools/llvm-spirv/Android.bp
new file mode 100644
index 00000000..dec1bb6c
--- /dev/null
+++ b/tools/llvm-spirv/Android.bp
@@ -0,0 +1,76 @@
+//
+// Copyright (C) 2016 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.
+//
+
+//=====================================================================
+// Executable llvm-spirv
+//=====================================================================
+
+cc_binary {
+ name: "llvm-spirv",
+ host_supported: true,
+
+ srcs: ["llvm-spirv.cpp"],
+
+ target: {
+ linux: {
+ host_ldlibs: [
+ "-lrt",
+ "-ldl",
+ "-lpthread",
+ ],
+ },
+ darwin: {
+ host_ldlibs: [
+ "-ldl",
+ "-lpthread",
+ ],
+ },
+ android: {
+ cflags: [
+ "-DNDEBUG=1",
+ ],
+ },
+ host: {
+ cflags: [
+ "-fno-rtti",
+ "-fno-exceptions",
+ ],
+ },
+ },
+
+ shared_libs: [
+ "libLLVM",
+ "libSPIRV",
+ ],
+
+ header_libs: ["llvm-headers"],
+
+ cflags: [
+ "-D_SPIRV_LLVM_API",
+ "-D__STDC_LIMIT_MACROS",
+ "-D__STDC_CONSTANT_MACROS",
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
+
+ product_variables: {
+ unbundled_build: {
+ // Don't build for unbundled branches
+ enabled: false,
+ },
+ },
+}
diff --git a/tools/llvm-spirv/Android.mk b/tools/llvm-spirv/Android.mk
deleted file mode 100644
index ec7f3b28..00000000
--- a/tools/llvm-spirv/Android.mk
+++ /dev/null
@@ -1,119 +0,0 @@
-#
-# Copyright (C) 2016 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-LLVM_SPIRV_ROOT_PATH := $(LOCAL_PATH)
-LLVM_ROOT := external/llvm
-
-LIBSPIRV_ROOT_PATH := $(LOCAL_PATH)/../../lib/SPIRV
-
-LLVM_SPIRV_SOURCES := \
- llvm-spirv.cpp
-
-#=====================================================================
-# Host Executable llvm-spirv
-#=====================================================================
-
-# Don't build for unbundled branches
-ifeq (,$(TARGET_BUILD_APPS))
-
-include $(CLEAR_VARS)
-include $(CLEAR_TBLGEN_VARS)
-LLVM_ROOT_PATH := external/llvm
-
-LOCAL_SRC_FILES := \
- $(LLVM_SPIRV_SOURCES)
-
-LOCAL_C_INCLUDES := \
- $(LIBSPIRV_ROOT_PATH) \
- $(LIBSPIRV_ROOT_PATH)/Mangler \
- $(LIBSPIRV_ROOT_PATH)/libSPIRV \
- $(LLVM_ROOT)/include \
- $(LLVM_ROOT)/host/include
-
-LOCAL_MODULE := llvm-spirv
-LOCAL_MODULE_CLASS := EXECUTABLES
-
-# TODO: handle windows and darwin
-
-LOCAL_MODULE_HOST_OS := linux darwin
-LOCAL_IS_HOST_MODULE := true
-
-LOCAL_LDLIBS_linux := -lrt -ldl -ltinfo -lpthread
-LOCAL_LDLIBS_darwin := -ldl -lpthread
-
-LOCAL_SHARED_LIBRARIES += libLLVM libSPIRV
-
-LOCAL_CFLAGS += $(TOOL_CFLAGS) \
- -D_SPIRV_LLVM_API \
- -Wno-error=pessimizing-move \
- -Wno-error=unused-variable \
- -Wno-error=unused-private-field \
- -Wno-error=unused-function \
- -Wno-error=dangling-else \
- -Wno-error=ignored-qualifiers
-
-include $(LLVM_ROOT)/llvm.mk
-include $(LLVM_GEN_INTRINSICS_MK)
-include $(LLVM_GEN_ATTRIBUTES_MK)
-include $(LLVM_HOST_BUILD_MK)
-include $(BUILD_HOST_EXECUTABLE)
-
-endif # Don't build in unbundled branches
-
-#=====================================================================
-# Device Executable llvm-spirv
-#=====================================================================
-ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)))
-
-include $(CLEAR_VARS)
-include $(CLEAR_TBLGEN_VARS)
-LLVM_ROOT_PATH := external/llvm
-
-LOCAL_SRC_FILES := \
- $(LLVM_SPIRV_SOURCES)
-
-LOCAL_C_INCLUDES := \
- $(LIBSPIRV_ROOT_PATH) \
- $(LIBSPIRV_ROOT_PATH)/Mangler \
- $(LIBSPIRV_ROOT_PATH)/libSPIRV
-
-LOCAL_MODULE := llvm-spirv
-LOCAL_MODULE_CLASS := EXECUTABLES
-
-LOCAL_SHARED_LIBRARIES += libSPIRV libLLVM
-
-LOCAL_CFLAGS += $(TOOL_CFLAGS) \
- -D_SPIRV_LLVM_API \
- -DNDEBUG=1 \
- -Wno-error=pessimizing-move \
- -Wno-error=unused-variable \
- -Wno-error=unused-private-field \
- -Wno-error=unused-function \
- -Wno-error=dangling-else \
- -Wno-error=ignored-qualifiers
-
-include $(LLVM_GEN_INTRINSICS_MK)
-include $(LLVM_GEN_ATTRIBUTES_MK)
-include $(LLVM_DEVICE_BUILD_MK)
-include $(BUILD_EXECUTABLE)
-
-endif # Don't build in unbundled branches
-
-#=====================================================================
-# Include Subdirectories
-#=====================================================================
-include $(call all-makefiles-under,$(LOCAL_PATH))