blob: 4b753456afa797df92c1adaf346acf7882a9de3c [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
17cc_defaults {
18 name: "swiftshader_common",
19
20 gnu_extensions: false,
21
22 cflags: [
23 "-Xclang", "-fuse-init-array",
24 "-fno-operator-names",
25 "-msse2",
26 "-Werror",
27 "-Wwrite-strings",
28 ],
29
30 cppflags: [
31 "-Woverloaded-virtual",
Hernan Liatis04c0eac2019-04-29 17:03:34 -070032 "-DVK_USE_PLATFORM_ANDROID_KHR",
Alistair Strachan60f86622018-03-22 17:37:55 -070033 ],
Stephen Hines44994a82018-11-15 17:53:50 -080034 cpp_std: "c++11",
Alistair Strachan60f86622018-03-22 17:37:55 -070035
36 target: {
37 host: {
38 cppflags: [
39 "-fno-rtti",
40 "-fno-exceptions",
41 ],
42 compile_multilib: "64",
43 },
44
45 // We don't need Darwin host-side builds
46 darwin: {
47 enabled: false,
48 },
49 },
50}
51
52cc_defaults {
53 name: "swiftshader_common_release",
54
55 defaults: [ "swiftshader_common" ],
56
57 cflags: [
58 "-Os",
59 "-fomit-frame-pointer",
60 "-ffunction-sections",
61 "-fdata-sections",
62 ],
63}
64
65cc_defaults {
66 name: "swiftshader_common_debug",
67
68 defaults: [ "swiftshader_common" ],
69
70 cflags: [
71 "-O0",
72 "-g",
73 "-UNDEBUG",
74 ],
75}
76
77cc_defaults {
78 name: "swiftshader_subzero",
79
80 cflags: [
81 "-DALLOW_DUMP=0",
82 "-DALLOW_TIMERS=0",
83 "-DALLOW_LLVM_CL=0",
84 "-DALLOW_LLVM_IR=0",
85 "-DALLOW_LLVM_IR_AS_INPUT=0",
86 "-DALLOW_MINIMAL_BUILD=0",
87 "-DALLOW_WASM=0",
88 "-DICE_THREAD_LOCAL_HACK=1",
89 ],
90}
91
92cc_library_headers {
93 name: "swiftshader_platform_headers",
94 host_supported: true,
Chris Forbes0deebed2019-04-05 10:07:33 -070095 device_supported: true,
96 vendor_available: true,
Alistair Strachan60f86622018-03-22 17:37:55 -070097 export_include_dirs: ["include"],
98}
99
100cc_library_headers {
101 name: "swiftshader_host_headers",
102 device_supported: false,
103 host_supported: true,
104 export_include_dirs: ["include/Android"],
105}
106
Alistair Strachan60f86622018-03-22 17:37:55 -0700107subdirs = [
108 "src",
109 "third_party/llvm-subzero",
Ben Claytond632e6d2019-04-12 16:51:47 -0400110 "third_party/llvm-7.0",
Alistair Strachan60f86622018-03-22 17:37:55 -0700111 "third_party/subzero",
112]