Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 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 | |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 17 | LOCAL_PATH := $(call my-dir) |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 18 | |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 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. |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 26 | ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm)) |
Logan Chien | 2ecc8b7 | 2018-09-10 22:14:20 +0800 | [diff] [blame] | 27 | SWIFTSHADER_USE_SUBZERO := true |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 28 | endif |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 29 | endif |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 30 | |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 31 | |
| 32 | # Check whether SwiftShader requires full C++ 11 support. |
Logan Chien | 2ecc8b7 | 2018-09-10 22:14:20 +0800 | [diff] [blame] | 33 | ifdef SWIFTSHADER_USE_SUBZERO |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame^] | 34 | swiftshader_requires_cxx11 := true |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 35 | endif |
| 36 | |
| 37 | ifeq ($(SWIFTSHADER_LLVM_VERSION),7) |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame^] | 38 | swiftshader_requires_cxx11 := true |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 39 | endif |
| 40 | |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame^] | 41 | ifeq ($(swiftshader_requires_cxx11),true) |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 42 | # Full C++ 11 support is only available from Marshmallow and up. |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 43 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow) |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame^] | 44 | swiftshader_unsupported_build := true |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 45 | endif |
| 46 | endif |
| 47 | |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 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)) |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame^] | 52 | swiftshader_unsupported_build := true |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 53 | endif |
| 54 | endif |
| 55 | |
| 56 | ifeq ($(SWIFTSHADER_LLVM_VERSION),7) |
| 57 | ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64)) |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame^] | 58 | swiftshader_unsupported_build := true |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 59 | endif |
| 60 | endif |
| 61 | |
| 62 | |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame^] | 63 | ifndef swiftshader_unsupported_build |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 64 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
| 65 | endif |