OSDN Git Service

Disable surface and swapchain support for Android
[android-x86/external-swiftshader.git] / Android.mk
1 #
2 # Copyright 2015 The Android Open-Source Project
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 LOCAL_PATH := $(call my-dir)
18 swiftshader_root := $(LOCAL_PATH)
19
20 # Default LLVM version for SwiftShader's JIT compiler (Reactor).
21 REACTOR_LLVM_VERSION ?= 7
22
23 # Subzero is an alternative JIT compiler. It is smaller and generally slower.
24 REACTOR_USE_SUBZERO := false
25
26 ifeq ($(REACTOR_LLVM_VERSION),3)
27 # Reactor with LLVM 3.0 doesn't support ARM.  Use Subzero as the Reactor JIT
28 # back-end on ARM.
29 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm))
30 REACTOR_USE_SUBZERO := true
31 endif
32 endif
33
34 # Subzero and LLVM 7.0 require C++11.
35 # Full C++11 support is only available from Marshmallow and up.
36 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
37 # Fall back to LLVM 3.0.
38 REACTOR_USE_SUBZERO := false
39 REACTOR_LLVM_VERSION := 3
40 endif
41
42 # Check whether $(TARGET_ARCH) is supported.
43 ifeq ($(REACTOR_LLVM_VERSION),3)
44 ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm))
45 swiftshader_unsupported_build := true
46 endif
47 endif
48
49 ifeq ($(REACTOR_LLVM_VERSION),7)
50 ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
51 swiftshader_unsupported_build := true
52 endif
53 endif
54
55 ifneq ($(swiftshader_unsupported_build),true)
56 include $(swiftshader_root)/src/Android.mk
57 include $(swiftshader_root)/tests/GLESUnitTests/Android.mk
58 ifeq ($(REACTOR_LLVM_VERSION),3)
59 include $(swiftshader_root)/third_party/LLVM/Android.mk
60 else
61 include $(swiftshader_root)/third_party/llvm-7.0/Android.mk
62 endif
63 endif