Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2018 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 | 0ca03fb | 2021-05-10 13:37:21 -0400 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["external_swiftshader_license"], |
| 19 | } |
| 20 | |
| 21 | // Added automatically by a large-scale-change that took the approach of |
| 22 | // 'apply every license found to every target'. While this makes sure we respect |
| 23 | // every license restriction, it may not be entirely correct. |
| 24 | // |
| 25 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 26 | // |
| 27 | // Please consider splitting the single license below into multiple licenses, |
| 28 | // taking care not to lose any license_kind information, and overriding the |
| 29 | // default license using the 'licenses: [...]' property on targets as needed. |
| 30 | // |
| 31 | // For unused files, consider creating a 'filegroup' with "//visibility:private" |
| 32 | // to attach the license to, and including a comment whether the files may be |
| 33 | // used in the current project. |
| 34 | // |
| 35 | // large-scale-change filtered out the below license kinds as false-positives: |
| 36 | // SPDX-license-identifier-GPL |
| 37 | // SPDX-license-identifier-GPL-3.0 |
| 38 | // http://go/android-license-faq |
| 39 | license { |
| 40 | name: "external_swiftshader_license", |
| 41 | visibility: [":__subpackages__"], |
| 42 | license_kinds: [ |
| 43 | "SPDX-license-identifier-Apache-2.0", |
| 44 | "SPDX-license-identifier-BSD", |
| 45 | "SPDX-license-identifier-MIT", |
| 46 | "SPDX-license-identifier-NCSA", |
| 47 | "legacy_unencumbered", |
| 48 | ], |
| 49 | license_text: [ |
| 50 | "LICENSE.txt", |
| 51 | ], |
| 52 | } |
| 53 | |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 54 | cc_defaults { |
| 55 | name: "swiftshader_common", |
| 56 | |
| 57 | gnu_extensions: false, |
| 58 | |
| 59 | cflags: [ |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 60 | "-Werror", |
| 61 | "-Wwrite-strings", |
| 62 | ], |
| 63 | |
| 64 | cppflags: [ |
| 65 | "-Woverloaded-virtual", |
Hernan Liatis | 04c0eac | 2019-04-29 17:03:34 -0700 | [diff] [blame] | 66 | "-DVK_USE_PLATFORM_ANDROID_KHR", |
Nicolas Capens | a4347a9 | 2020-03-01 08:29:25 -0500 | [diff] [blame] | 67 | "-DVK_EXPORT= ", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 68 | ], |
Nicolas Capens | b3e5c44 | 2021-01-20 06:16:24 +0000 | [diff] [blame] | 69 | cpp_std: "c++17", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 70 | |
Yi Kong | 83002b0 | 2021-09-23 16:34:15 +0800 | [diff] [blame] | 71 | arch: { |
| 72 | x86: { |
| 73 | cflags: [ |
| 74 | "-msse2", |
| 75 | ], |
| 76 | }, |
| 77 | x86_64: { |
| 78 | cflags: [ |
| 79 | "-msse2", |
| 80 | ], |
| 81 | }, |
| 82 | }, |
| 83 | |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 84 | target: { |
| 85 | host: { |
| 86 | cppflags: [ |
| 87 | "-fno-rtti", |
| 88 | "-fno-exceptions", |
| 89 | ], |
| 90 | compile_multilib: "64", |
| 91 | }, |
| 92 | |
| 93 | // We don't need Darwin host-side builds |
| 94 | darwin: { |
| 95 | enabled: false, |
| 96 | }, |
| 97 | }, |
| 98 | } |
| 99 | |
| 100 | cc_defaults { |
| 101 | name: "swiftshader_common_release", |
| 102 | |
| 103 | defaults: [ "swiftshader_common" ], |
| 104 | |
| 105 | cflags: [ |
| 106 | "-Os", |
| 107 | "-fomit-frame-pointer", |
| 108 | "-ffunction-sections", |
| 109 | "-fdata-sections", |
| 110 | ], |
| 111 | } |
| 112 | |
| 113 | cc_defaults { |
| 114 | name: "swiftshader_common_debug", |
| 115 | |
| 116 | defaults: [ "swiftshader_common" ], |
| 117 | |
| 118 | cflags: [ |
| 119 | "-O0", |
| 120 | "-g", |
| 121 | "-UNDEBUG", |
| 122 | ], |
| 123 | } |
| 124 | |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 125 | cc_library_headers { |
| 126 | name: "swiftshader_platform_headers", |
| 127 | host_supported: true, |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 128 | device_supported: true, |
| 129 | vendor_available: true, |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 130 | export_include_dirs: ["include"], |
| 131 | } |
| 132 | |
| 133 | cc_library_headers { |
| 134 | name: "swiftshader_host_headers", |
| 135 | device_supported: false, |
| 136 | host_supported: true, |
| 137 | export_include_dirs: ["include/Android"], |
| 138 | } |