Commit 17b75890 by Logan Chien

Add LLVM 7.0 Android.mk

Change-Id: Ic1ae2c2872cc9f270557a6d4b701f870f82bd3cf Reviewed-on: https://swiftshader-review.googlesource.com/20479Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarLogan Chien <loganchien@google.com>
parent 009fecb2
......@@ -16,20 +16,50 @@
LOCAL_PATH := $(call my-dir)
# Use Subzero as the Reactor JIT back-end on ARM, else LLVM.
# LLVM version for SwiftShader
SWIFTSHADER_LLVM_VERSION ?= 3
ifeq ($(SWIFTSHADER_LLVM_VERSION),3)
# Reactor with LLVM 3.0 doesn't support ARM. Use Subzero as the Reactor JIT
# back-end on ARM.
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm))
use_subzero := true
endif
endif
# Subzero requires full C++11 support, which is available from Marshmallow and up.
# Check whether SwiftShader requires full C++ 11 support.
ifdef use_subzero
SWIFTSHADER_REQUIRES_CXX11 := true
endif
ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
SWIFTSHADER_REQUIRES_CXX11 := true
endif
ifeq ($(SWIFTSHADER_REQUIRES_CXX11),true)
# Full C++ 11 support is only available from Marshmallow and up.
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
unsupported_build := true
endif
endif
# Check whether $(TARGET_ARCH) is supported.
ifeq ($(SWIFTSHADER_LLVM_VERSION),3)
ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm))
unsupported_build := true
endif
endif
ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
unsupported_build := true
endif
endif
ifndef unsupported_build
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm))
include $(call all-makefiles-under,$(LOCAL_PATH))
endif
endif
\ No newline at end of file
......@@ -7,14 +7,25 @@ COMMON_C_INCLUDES += \
$(LOCAL_PATH)
ifdef use_subzero
COMMON_C_INCLUDES += \
$(LOCAL_PATH)/../third_party/subzero/ \
$(LOCAL_PATH)/../third_party/llvm-subzero/include/ \
$(LOCAL_PATH)/../third_party/llvm-subzero/build/Android/include/ \
$(LOCAL_PATH)/../third_party/subzero/pnacl-llvm/include/
else
ifeq ($(SWIFTSHADER_LLVM_VERSION),3)
COMMON_C_INCLUDES += \
$(LOCAL_PATH)/../third_party/LLVM/include
else
COMMON_C_INCLUDES += \
$(LOCAL_PATH)/../third_party/llvm-7.0/llvm/include \
$(LOCAL_PATH)/../third_party/llvm-7.0/configs/android/include \
$(LOCAL_PATH)/../third_party/llvm-7.0/configs/common/include
endif
endif
# Project Treble is introduced from Oreo MR1
......@@ -138,6 +149,9 @@ COMMON_C_INCLUDES += \
system/core/libsync
endif
# Common LLVM defines
COMMON_CFLAGS += -DSWIFTSHADER_LLVM_VERSION=$(SWIFTSHADER_LLVM_VERSION)
# Common Subzero defines
COMMON_CFLAGS += -DALLOW_DUMP=0 -DALLOW_TIMERS=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_MINIMAL_BUILD=0 -DALLOW_WASM=0 -DICE_THREAD_LOCAL_HACK=1
......
#
# Copyright 2018 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)
include $(call all-makefiles-under,$(LOCAL_PATH))
#
# Copyright 2018 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)
ifneq ($(wildcard $(LOCAL_PATH)/../../third_party/googletest/googletest/src/gtest-all.cc),)
include $(CLEAR_VARS)
LOCAL_MODULE := libgtest_all_swiftshader
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := \
../../third_party/googletest/googletest/src/gtest-all.cc
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../third_party/googletest/googletest/include/ \
$(LOCAL_PATH)/../../third_party/googletest/googlemock/include/ \
$(LOCAL_PATH)/../../third_party/googletest/googletest/
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := swiftshader-unittests
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true
LOCAL_SRC_FILES := \
main.cpp \
unittests.cpp
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../third_party/googletest/googletest/include/ \
$(LOCAL_PATH)/../../third_party/googletest/googlemock/include/ \
$(LOCAL_PATH)/../../third_party/googletest/googletest/ \
$(LOCAL_PATH)/../../include/
LOCAL_SHARED_LIBRARIES := \
libEGL_swiftshader \
libGLESv2_swiftshader
LOCAL_STATIC_LIBRARIES := \
libgtest_all_swiftshader
include $(BUILD_EXECUTABLE)
endif # gtest-all.cc exists
......@@ -16,4 +16,8 @@
LOCAL_PATH:= $(call my-dir)
include $(call all-makefiles-under,$(LOCAL_PATH))
ifeq ($(SWIFTSHADER_LLVM_VERSION),3)
include $(LOCAL_PATH)/LLVM/Android.mk
else
include $(LOCAL_PATH)/llvm-7.0/Android.mk
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment