summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2016-12-15 17:55:41 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-12-15 17:55:41 +0000
commit3b70002eea64e795316899941775a9932fa4c42f (patch)
treebb484f51912009ab247e2c67c00c7d4adde075f8
parent6de93ba9a5643378204bebc5605c534a59cac119 (diff)
parent1b2462f560fb211b8fef772d65543f9c719c6e46 (diff)
downloadspirv-llvm-3b70002eea64e795316899941775a9932fa4c42f.tar.gz
Revert "Convert spirv-llvm to Android.bp"
am: 1b2462f560 Change-Id: I4f219393628c89c236f0f3b1461448835a09b9f7
-rw-r--r--Android.bp4
-rw-r--r--Android.mk7
-rw-r--r--lib/Android.mk7
-rw-r--r--lib/SPIRV/Android.bp105
-rw-r--r--lib/SPIRV/Android.mk158
-rw-r--r--tools/Android.mk7
-rw-r--r--tools/llvm-spirv/Android.bp70
-rw-r--r--tools/llvm-spirv/Android.mk119
8 files changed, 298 insertions, 179 deletions
diff --git a/Android.bp b/Android.bp
deleted file mode 100644
index 7866be1d..00000000
--- a/Android.bp
+++ /dev/null
@@ -1,4 +0,0 @@
-subdirs = [
- "lib/SPIRV",
- "tools/llvm-spirv",
-]
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 00000000..933e54f7
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,7 @@
+#=====================================================================
+# 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
new file mode 100644
index 00000000..933e54f7
--- /dev/null
+++ b/lib/Android.mk
@@ -0,0 +1,7 @@
+#=====================================================================
+# 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
deleted file mode 100644
index bab283e8..00000000
--- a/lib/SPIRV/Android.bp
+++ /dev/null
@@ -1,105 +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.
-//
-
-
-//=====================================================================
-// 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",
- ],
-
- local_include_dirs: [
- "libSPIRV",
- "Mangler",
- ],
-
- export_include_dirs: ["."],
-
- header_libs: ["llvm-headers"],
-
- compile_multilib: "first",
-
- target: {
- android: {
- cflags: ["-Wno-error=non-virtual-dtor"],
- },
- 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
new file mode 100644
index 00000000..65b74378
--- /dev/null
+++ b/lib/SPIRV/Android.mk
@@ -0,0 +1,158 @@
+#
+# 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
new file mode 100644
index 00000000..933e54f7
--- /dev/null
+++ b/tools/Android.mk
@@ -0,0 +1,7 @@
+#=====================================================================
+# 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
deleted file mode 100644
index d5c14227..00000000
--- a/tools/llvm-spirv/Android.bp
+++ /dev/null
@@ -1,70 +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.
-//
-
-//=====================================================================
-// 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",
- ],
- },
- },
-
- 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
new file mode 100644
index 00000000..ec7f3b28
--- /dev/null
+++ b/tools/llvm-spirv/Android.mk
@@ -0,0 +1,119 @@
+#
+# 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))