blob: 9a6f9c1b4074d1cf4595a53882d5e33d8578e652 [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",
32 ],
Stephen Hines44994a82018-11-15 17:53:50 -080033 cpp_std: "c++11",
Alistair Strachan60f86622018-03-22 17:37:55 -070034
35 target: {
36 host: {
37 cppflags: [
38 "-fno-rtti",
39 "-fno-exceptions",
40 ],
41 compile_multilib: "64",
42 },
43
44 // We don't need Darwin host-side builds
45 darwin: {
46 enabled: false,
47 },
48 },
49}
50
51cc_defaults {
52 name: "swiftshader_common_release",
53
54 defaults: [ "swiftshader_common" ],
55
56 cflags: [
57 "-Os",
58 "-fomit-frame-pointer",
59 "-ffunction-sections",
60 "-fdata-sections",
61 ],
62}
63
64cc_defaults {
65 name: "swiftshader_common_debug",
66
67 defaults: [ "swiftshader_common" ],
68
69 cflags: [
70 "-O0",
71 "-g",
72 "-UNDEBUG",
73 ],
74}
75
76cc_defaults {
77 name: "swiftshader_subzero",
78
79 cflags: [
80 "-DALLOW_DUMP=0",
81 "-DALLOW_TIMERS=0",
82 "-DALLOW_LLVM_CL=0",
83 "-DALLOW_LLVM_IR=0",
84 "-DALLOW_LLVM_IR_AS_INPUT=0",
85 "-DALLOW_MINIMAL_BUILD=0",
86 "-DALLOW_WASM=0",
87 "-DICE_THREAD_LOCAL_HACK=1",
88 ],
89}
90
91cc_library_headers {
92 name: "swiftshader_platform_headers",
93 host_supported: true,
Chris Forbes0deebed2019-04-05 10:07:33 -070094 device_supported: true,
95 vendor_available: true,
Alistair Strachan60f86622018-03-22 17:37:55 -070096 export_include_dirs: ["include"],
97}
98
99cc_library_headers {
100 name: "swiftshader_host_headers",
101 device_supported: false,
102 host_supported: true,
103 export_include_dirs: ["include/Android"],
104}
105
Alistair Strachan60f86622018-03-22 17:37:55 -0700106subdirs = [
107 "src",
108 "third_party/llvm-subzero",
Ben Claytond632e6d2019-04-12 16:51:47 -0400109 "third_party/llvm-7.0",
Alistair Strachan60f86622018-03-22 17:37:55 -0700110 "third_party/subzero",
111]