blob: 893ca07c33cf19c90a64cf8e2553387e57ee37d5 [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))
27use_subzero := true
28endif
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.
Nicolas Capens352e56c2017-08-10 16:57:25 -040033ifdef use_subzero
Logan Chien17b75892018-08-27 10:49:24 +080034SWIFTSHADER_REQUIRES_CXX11 := true
35endif
36
37ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
38SWIFTSHADER_REQUIRES_CXX11 := true
39endif
40
41ifeq ($(SWIFTSHADER_REQUIRES_CXX11),true)
42# 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)
44unsupported_build := true
45endif
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))
52unsupported_build := true
53endif
54endif
55
56ifeq ($(SWIFTSHADER_LLVM_VERSION),7)
57ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
58unsupported_build := true
59endif
60endif
61
62
Nicolas Capens352e56c2017-08-10 16:57:25 -040063ifndef unsupported_build
Greg Hartman8527e472015-11-02 13:08:12 -080064include $(call all-makefiles-under,$(LOCAL_PATH))
65endif