blob: b40af6485ad2cf72c297ac405982a9175c3f4aba [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 "-msse2",
61 "-Werror",
62 "-Wwrite-strings",
63 ],
64
65 cppflags: [
66 "-Woverloaded-virtual",
Hernan Liatis04c0eac2019-04-29 17:03:34 -070067 "-DVK_USE_PLATFORM_ANDROID_KHR",
Nicolas Capensa4347a92020-03-01 08:29:25 -050068 "-DVK_EXPORT= ",
Alistair Strachan60f86622018-03-22 17:37:55 -070069 ],
Nicolas Capensb3e5c442021-01-20 06:16:24 +000070 cpp_std: "c++17",
Alistair Strachan60f86622018-03-22 17:37:55 -070071
72 target: {
73 host: {
74 cppflags: [
75 "-fno-rtti",
76 "-fno-exceptions",
77 ],
78 compile_multilib: "64",
79 },
80
81 // We don't need Darwin host-side builds
82 darwin: {
83 enabled: false,
84 },
85 },
86}
87
88cc_defaults {
89 name: "swiftshader_common_release",
90
91 defaults: [ "swiftshader_common" ],
92
93 cflags: [
94 "-Os",
95 "-fomit-frame-pointer",
96 "-ffunction-sections",
97 "-fdata-sections",
98 ],
99}
100
101cc_defaults {
102 name: "swiftshader_common_debug",
103
104 defaults: [ "swiftshader_common" ],
105
106 cflags: [
107 "-O0",
108 "-g",
109 "-UNDEBUG",
110 ],
111}
112
Alistair Strachan60f86622018-03-22 17:37:55 -0700113cc_library_headers {
114 name: "swiftshader_platform_headers",
115 host_supported: true,
Chris Forbes0deebed2019-04-05 10:07:33 -0700116 device_supported: true,
117 vendor_available: true,
Alistair Strachan60f86622018-03-22 17:37:55 -0700118 export_include_dirs: ["include"],
119}
120
121cc_library_headers {
122 name: "swiftshader_host_headers",
123 device_supported: false,
124 host_supported: true,
125 export_include_dirs: ["include/Android"],
126}