blob: f8c596fa63539164d33a3fd5733d95027e1f6f2e [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 ],
33
34 target: {
35 host: {
36 cppflags: [
37 "-fno-rtti",
38 "-fno-exceptions",
39 ],
40 compile_multilib: "64",
41 },
42
43 // We don't need Darwin host-side builds
44 darwin: {
45 enabled: false,
46 },
47 },
48}
49
50cc_defaults {
51 name: "swiftshader_common_release",
52
53 defaults: [ "swiftshader_common" ],
54
55 cflags: [
56 "-Os",
57 "-fomit-frame-pointer",
58 "-ffunction-sections",
59 "-fdata-sections",
60 ],
61}
62
63cc_defaults {
64 name: "swiftshader_common_debug",
65
66 defaults: [ "swiftshader_common" ],
67
68 cflags: [
69 "-O0",
70 "-g",
71 "-UNDEBUG",
72 ],
73}
74
75cc_defaults {
76 name: "swiftshader_subzero",
77
78 cflags: [
79 "-DALLOW_DUMP=0",
80 "-DALLOW_TIMERS=0",
81 "-DALLOW_LLVM_CL=0",
82 "-DALLOW_LLVM_IR=0",
83 "-DALLOW_LLVM_IR_AS_INPUT=0",
84 "-DALLOW_MINIMAL_BUILD=0",
85 "-DALLOW_WASM=0",
86 "-DICE_THREAD_LOCAL_HACK=1",
87 ],
88}
89
90cc_library_headers {
91 name: "swiftshader_platform_headers",
92 host_supported: true,
93 export_include_dirs: ["include"],
94}
95
96cc_library_headers {
97 name: "swiftshader_host_headers",
98 device_supported: false,
99 host_supported: true,
100 export_include_dirs: ["include/Android"],
101}
102
103subdirs = [
104 "src",
105 "third_party/llvm-subzero",
106 "third_party/LLVM",
107 "third_party/subzero",
108]