OSDN Git Service

Add LLVM 7.0 Android.mk
[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
19 # LLVM version for SwiftShader
20 SWIFTSHADER_LLVM_VERSION ?= 3
21
22
23 ifeq ($(SWIFTSHADER_LLVM_VERSION),3)
24 # Reactor with LLVM 3.0 doesn't support ARM.  Use Subzero as the Reactor JIT
25 # back-end on ARM.
26 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm))
27 use_subzero := true
28 endif
29 endif
30
31
32 # Check whether SwiftShader requires full C++ 11 support.
33 ifdef use_subzero
34 SWIFTSHADER_REQUIRES_CXX11 := true
35 endif
36
37 ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
38 SWIFTSHADER_REQUIRES_CXX11 := true
39 endif
40
41 ifeq ($(SWIFTSHADER_REQUIRES_CXX11),true)
42 # Full C++ 11 support is only available from Marshmallow and up.
43 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
44 unsupported_build := true
45 endif
46 endif
47
48
49 # Check whether $(TARGET_ARCH) is supported.
50 ifeq ($(SWIFTSHADER_LLVM_VERSION),3)
51 ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm))
52 unsupported_build := true
53 endif
54 endif
55
56 ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
57 ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
58 unsupported_build := true
59 endif
60 endif
61
62
63 ifndef unsupported_build
64 include $(call all-makefiles-under,$(LOCAL_PATH))
65 endif