blob: 69319368c1d061850b1400d4b7b76a5bb2cd5d3c [file] [log] [blame]
Alistair Strachan60f86622018-03-22 17:37:55 -07001//
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 Capens0ca03fb2021-05-10 13:37:21 -040017package {
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
39license {
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 Strachan60f86622018-03-22 17:37:55 -070054cc_defaults {
55 name: "swiftshader_common",
56
57 gnu_extensions: false,
58
59 cflags: [
Alistair Strachan60f86622018-03-22 17:37:55 -070060 "-Werror",
61 "-Wwrite-strings",
62 ],
63
64 cppflags: [
65 "-Woverloaded-virtual",
Hernan Liatis04c0eac2019-04-29 17:03:34 -070066 "-DVK_USE_PLATFORM_ANDROID_KHR",
Nicolas Capensa4347a92020-03-01 08:29:25 -050067 "-DVK_EXPORT= ",
Alistair Strachan60f86622018-03-22 17:37:55 -070068 ],
Nicolas Capensb3e5c442021-01-20 06:16:24 +000069 cpp_std: "c++17",
Alistair Strachan60f86622018-03-22 17:37:55 -070070
Yi Kong83002b02021-09-23 16:34:15 +080071 arch: {
72 x86: {
73 cflags: [
74 "-msse2",
75 ],
76 },
77 x86_64: {
78 cflags: [
79 "-msse2",
80 ],
81 },
82 },
83
Alistair Strachan60f86622018-03-22 17:37:55 -070084 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
100cc_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
113cc_defaults {
114 name: "swiftshader_common_debug",
115
116 defaults: [ "swiftshader_common" ],
117
118 cflags: [
119 "-O0",
120 "-g",
121 "-UNDEBUG",
122 ],
123}
124
Alistair Strachan60f86622018-03-22 17:37:55 -0700125cc_library_headers {
126 name: "swiftshader_platform_headers",
127 host_supported: true,
Chris Forbes0deebed2019-04-05 10:07:33 -0700128 device_supported: true,
129 vendor_available: true,
Alistair Strachan60f86622018-03-22 17:37:55 -0700130 export_include_dirs: ["include"],
131}
132
133cc_library_headers {
134 name: "swiftshader_host_headers",
135 device_supported: false,
136 host_supported: true,
137 export_include_dirs: ["include/Android"],
138}