OSDN Git Service

Rename SWIFTSHADER_LLVM_VERSION to REACTOR_LLVM_VERSION.
[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 # LLVM version for SwiftShader
21 REACTOR_LLVM_VERSION ?= 3
22
23
24 ifeq ($(REACTOR_LLVM_VERSION),3)
25 # Reactor with LLVM 3.0 doesn't support ARM.  Use Subzero as the Reactor JIT
26 # back-end on ARM.
27 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm))
28 SWIFTSHADER_USE_SUBZERO := true
29 endif
30 endif
31
32
33 # Check whether SwiftShader requires full C++ 11 support.
34 ifdef SWIFTSHADER_USE_SUBZERO
35 swiftshader_requires_cxx11 := true
36 endif
37
38 ifeq ($(REACTOR_LLVM_VERSION),7)
39 swiftshader_requires_cxx11 := true
40 endif
41
42 ifeq ($(swiftshader_requires_cxx11),true)
43 # Full C++ 11 support is only available from Marshmallow and up.
44 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
45 swiftshader_unsupported_build := true
46 endif
47 endif
48
49
50 # Check whether $(TARGET_ARCH) is supported.
51 ifeq ($(REACTOR_LLVM_VERSION),3)
52 ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm))
53 swiftshader_unsupported_build := true
54 endif
55 endif
56
57 ifeq ($(REACTOR_LLVM_VERSION),7)
58 ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
59 swiftshader_unsupported_build := true
60 endif
61 endif
62
63
64 ifneq ($(swiftshader_unsupported_build),true)
65 include $(swiftshader_root)/src/Android.mk
66 include $(swiftshader_root)/tests/unittests/Android.mk
67 ifeq ($(REACTOR_LLVM_VERSION),3)
68 include $(swiftshader_root)/third_party/LLVM/Android.mk
69 else
70 include $(swiftshader_root)/third_party/llvm-7.0/Android.mk
71 endif
72 endif