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) |
Merck Hung | 90c0c55 | 2018-09-28 16:08:14 +0800 | [diff] [blame] | 18 | swiftshader_root := $(LOCAL_PATH) |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 19 | |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 20 | # LLVM version for SwiftShader |
Nicolas Capens | f417d9d | 2018-10-10 10:49:30 -0400 | [diff] [blame] | 21 | REACTOR_LLVM_VERSION ?= 3 |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 22 | |
| 23 | |
Nicolas Capens | f417d9d | 2018-10-10 10:49:30 -0400 | [diff] [blame] | 24 | ifeq ($(REACTOR_LLVM_VERSION),3) |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 25 | # Reactor with LLVM 3.0 doesn't support ARM. Use Subzero as the Reactor JIT |
| 26 | # back-end on ARM. |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 27 | ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm)) |
Logan Chien | 2ecc8b7 | 2018-09-10 22:14:20 +0800 | [diff] [blame] | 28 | SWIFTSHADER_USE_SUBZERO := true |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 29 | endif |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 30 | endif |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 31 | |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 32 | |
| 33 | # Check whether SwiftShader requires full C++ 11 support. |
Logan Chien | 2ecc8b7 | 2018-09-10 22:14:20 +0800 | [diff] [blame] | 34 | ifdef SWIFTSHADER_USE_SUBZERO |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame] | 35 | swiftshader_requires_cxx11 := true |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 36 | endif |
| 37 | |
Nicolas Capens | f417d9d | 2018-10-10 10:49:30 -0400 | [diff] [blame] | 38 | ifeq ($(REACTOR_LLVM_VERSION),7) |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame] | 39 | swiftshader_requires_cxx11 := true |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 40 | endif |
| 41 | |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame] | 42 | ifeq ($(swiftshader_requires_cxx11),true) |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 43 | # Full C++ 11 support is only available from Marshmallow and up. |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 44 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow) |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame] | 45 | swiftshader_unsupported_build := true |
Nicolas Capens | 352e56c | 2017-08-10 16:57:25 -0400 | [diff] [blame] | 46 | endif |
| 47 | endif |
| 48 | |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 49 | |
| 50 | # Check whether $(TARGET_ARCH) is supported. |
Nicolas Capens | f417d9d | 2018-10-10 10:49:30 -0400 | [diff] [blame] | 51 | ifeq ($(REACTOR_LLVM_VERSION),3) |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 52 | ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm)) |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame] | 53 | swiftshader_unsupported_build := true |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 54 | endif |
| 55 | endif |
| 56 | |
Nicolas Capens | f417d9d | 2018-10-10 10:49:30 -0400 | [diff] [blame] | 57 | ifeq ($(REACTOR_LLVM_VERSION),7) |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 58 | ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64)) |
Logan Chien | 6aad6a7 | 2018-09-25 17:59:20 +0800 | [diff] [blame] | 59 | swiftshader_unsupported_build := true |
Logan Chien | 17b7589 | 2018-08-27 10:49:24 +0800 | [diff] [blame] | 60 | endif |
| 61 | endif |
| 62 | |
| 63 | |
Merck Hung | 90c0c55 | 2018-09-28 16:08:14 +0800 | [diff] [blame] | 64 | ifneq ($(swiftshader_unsupported_build),true) |
| 65 | include $(swiftshader_root)/src/Android.mk |
Alexis Hetu | d16a504 | 2018-10-17 10:10:23 -0400 | [diff] [blame^] | 66 | include $(swiftshader_root)/tests/GLESUnitTests/Android.mk |
Nicolas Capens | f417d9d | 2018-10-10 10:49:30 -0400 | [diff] [blame] | 67 | ifeq ($(REACTOR_LLVM_VERSION),3) |
Merck Hung | 90c0c55 | 2018-09-28 16:08:14 +0800 | [diff] [blame] | 68 | include $(swiftshader_root)/third_party/LLVM/Android.mk |
| 69 | else |
| 70 | include $(swiftshader_root)/third_party/llvm-7.0/Android.mk |
| 71 | endif |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 72 | endif |