blob: 4eef358005e53f00fb2ac52a701eca4ee3a98b80 [file] [log] [blame]
Greg Hartman8527e472015-11-02 13:08:12 -08001#
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
Nicolas Capens352e56c2017-08-10 16:57:25 -040017LOCAL_PATH := $(call my-dir)
Greg Hartman8527e472015-11-02 13:08:12 -080018
Logan Chien17b75892018-08-27 10:49:24 +080019# LLVM version for SwiftShader
20SWIFTSHADER_LLVM_VERSION ?= 3
21
22
23ifeq ($(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.
Nicolas Capens352e56c2017-08-10 16:57:25 -040026ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm))
Logan Chien2ecc8b72018-09-10 22:14:20 +080027SWIFTSHADER_USE_SUBZERO := true
Nicolas Capens352e56c2017-08-10 16:57:25 -040028endif
Logan Chien17b75892018-08-27 10:49:24 +080029endif
Nicolas Capens352e56c2017-08-10 16:57:25 -040030
Logan Chien17b75892018-08-27 10:49:24 +080031
32# Check whether SwiftShader requires full C++ 11 support.
Logan Chien2ecc8b72018-09-10 22:14:20 +080033ifdef SWIFTSHADER_USE_SUBZERO
Logan Chien6aad6a72018-09-25 17:59:20 +080034swiftshader_requires_cxx11 := true
Logan Chien17b75892018-08-27 10:49:24 +080035endif
36
37ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
Logan Chien6aad6a72018-09-25 17:59:20 +080038swiftshader_requires_cxx11 := true
Logan Chien17b75892018-08-27 10:49:24 +080039endif
40
Logan Chien6aad6a72018-09-25 17:59:20 +080041ifeq ($(swiftshader_requires_cxx11),true)
Logan Chien17b75892018-08-27 10:49:24 +080042# Full C++ 11 support is only available from Marshmallow and up.
Nicolas Capens352e56c2017-08-10 16:57:25 -040043ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
Logan Chien6aad6a72018-09-25 17:59:20 +080044swiftshader_unsupported_build := true
Nicolas Capens352e56c2017-08-10 16:57:25 -040045endif
46endif
47
Logan Chien17b75892018-08-27 10:49:24 +080048
49# Check whether $(TARGET_ARCH) is supported.
50ifeq ($(SWIFTSHADER_LLVM_VERSION),3)
51ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm))
Logan Chien6aad6a72018-09-25 17:59:20 +080052swiftshader_unsupported_build := true
Logan Chien17b75892018-08-27 10:49:24 +080053endif
54endif
55
56ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
57ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
Logan Chien6aad6a72018-09-25 17:59:20 +080058swiftshader_unsupported_build := true
Logan Chien17b75892018-08-27 10:49:24 +080059endif
60endif
61
62
Logan Chien6aad6a72018-09-25 17:59:20 +080063ifndef swiftshader_unsupported_build
Greg Hartman8527e472015-11-02 13:08:12 -080064include $(call all-makefiles-under,$(LOCAL_PATH))
65endif