2 # Copyright 2015 The Android Open-Source Project
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 LOCAL_PATH := $(call my-dir)
19 # LLVM version for SwiftShader
20 SWIFTSHADER_LLVM_VERSION ?= 3
23 ifeq ($(SWIFTSHADER_LLVM_VERSION),3)
24 # Reactor with LLVM 3.0 doesn't support ARM. Use Subzero as the Reactor JIT
26 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm))
27 SWIFTSHADER_USE_SUBZERO := true
32 # Check whether SwiftShader requires full C++ 11 support.
33 ifdef SWIFTSHADER_USE_SUBZERO
34 swiftshader_requires_cxx11 := true
37 ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
38 swiftshader_requires_cxx11 := true
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 swiftshader_unsupported_build := true
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 swiftshader_unsupported_build := true
56 ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
57 ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
58 swiftshader_unsupported_build := true
63 ifndef swiftshader_unsupported_build
64 include $(call all-makefiles-under,$(LOCAL_PATH))