• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17LOCAL_PATH := $(call my-dir)
18swiftshader_root := $(LOCAL_PATH)
19
20# Default LLVM version for SwiftShader's JIT compiler (Reactor).
21REACTOR_LLVM_VERSION ?= 7
22
23# Subzero is an alternative JIT compiler. It is smaller and generally slower.
24REACTOR_USE_SUBZERO := false
25
26ifeq ($(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.
29ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm))
30REACTOR_USE_SUBZERO := true
31endif
32endif
33
34# Subzero and LLVM 7.0 require C++11.
35# Full C++11 support is only available from Marshmallow and up.
36ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
37# Fall back to LLVM 3.0.
38REACTOR_USE_SUBZERO := false
39REACTOR_LLVM_VERSION := 3
40endif
41
42# Check whether $(TARGET_ARCH) is supported.
43ifeq ($(REACTOR_LLVM_VERSION),3)
44ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm))
45swiftshader_unsupported_build := true
46endif
47endif
48
49ifeq ($(REACTOR_LLVM_VERSION),7)
50ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
51swiftshader_unsupported_build := true
52endif
53endif
54
55ifneq ($(swiftshader_unsupported_build),true)
56include $(swiftshader_root)/src/Android.mk
57include $(swiftshader_root)/tests/GLESUnitTests/Android.mk
58ifeq ($(REACTOR_LLVM_VERSION),3)
59include $(swiftshader_root)/third_party/LLVM/Android.mk
60else
61include $(swiftshader_root)/third_party/llvm-7.0/Android.mk
62endif
63endif
64