blob: 310f4bb1f06bf874bea7aa43f8751f3e0eb0e7f9 [file] [log] [blame]
Colin Cross1d3ac562016-12-07 14:21:42 -08001//
2// Copyright (C) 2014 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: "libbcc-defaults",
19 defaults: [
20 "llvm-defaults",
21 "llvm-generated-headers",
22 "rs-version",
23 "libbcc-targets",
24 ],
25
26 clang: true,
27 cflags: [
28 "-Wall",
29 "-Wno-unused-parameter",
30 "-Werror",
31 "-D__DISABLE_ASSERTS",
32 ],
33
34 target: {
35 android: {
36 cflags: [
37 "-DTARGET_BUILD",
38 ],
39 },
40 host: {
41 compile_multilib: "first",
42 cflags: [
43 "-D__HOST__",
44 ],
45 },
46 },
47
48 product_variables: {
49 eng: {
50 cflags: ["-U__DISABLE_ASSERTS"],
51 },
52 },
53
54 include_dirs: [
55 "frameworks/compile/libbcc/include",
56 "frameworks/rs",
57 ],
58}
59
60//=====================================================================
61// Architecture Selection
62//=====================================================================
63// Note: We should only use -DFORCE_ARCH_CODEGEN on target build.
64// For the host build, we will include as many architecture as possible,
65// so that we can test the execution engine easily.
66
67cc_defaults {
68 name: "libbcc-targets",
69 arch: {
70 arm: {
71 cflags: [
72 "-DFORCE_ARM_CODEGEN",
73 "-DARCH_ARM_HAVE_VFP",
74 ],
75 armv7_a_neon: {
76 cflags: [
77 "-DARCH_ARM_HAVE_VFP_D32",
78 "-DARCH_ARM_HAVE_NEON",
79 ],
80 },
81 },
82 arm64: {
83 cflags: [
84 "-DFORCE_ARM64_CODEGEN",
85 "-DARCH_ARM_HAVE_NEON",
86 "-DARCH_ARM_HAVE_VFP",
87 "-DARCH_ARM_HAVE_VFP_D32",
88 "-DDISABLE_CLCORE_NEON",
89 ],
90 },
91 mips: {
92 cflags: ["-DFORCE_MIPS_CODEGEN"],
93 },
94 mips64: {
95 cflags: ["-DFORCE_MIPS64_CODEGEN"],
96 },
97 },
98 target: {
99 android_x86: {
100 cflags: ["-DFORCE_X86_CODEGEN"],
101 },
102 android_x86_64: {
103 cflags: ["-DFORCE_X86_64_CODEGEN"],
104 },
105 arm_on_x86: {
106 cflags: [
107 "-DPROVIDE_ARM_CODEGEN",
108 "-DFORCE_BUILD_ARM",
109 ],
110 },
111 arm_on_x86_64: {
112 cflags: [
113 "-DPROVIDE_ARM_CODEGEN",
114 "-DFORCE_BUILD_ARM",
115 "-DPROVIDE_ARM64_CODEGEN",
116 ],
117 },
118 },
119}
120
121//=====================================================================
122// Shared Library libbcc
123//=====================================================================
124cc_library_shared {
125 name: "libbcc",
126 host_supported: true,
127
128 whole_static_libs: [
129 "libbccRenderscript",
130 "libbccCore",
131 "libbccSupport",
132 ],
133
134 shared_libs: [
135 "libbcinfo",
136 ],
137
138 target: {
139 windows: {
140 enabled: true,
141 shared_libs: ["libLLVM"],
142 },
143 darwin: {
144 host_ldlibs: [
145 "-ldl",
146 "-lpthread",
147 ],
148
149 shared_libs: ["libLLVM"],
150 },
151 linux: {
152 host_ldlibs: [
153 "-ldl",
154 "-lpthread",
155 ],
156 static_libs: ["libLLVMLinker"],
157 allow_undefined_symbols: true,
158 },
159 host: {
160 compile_multilib: "first",
161 static_libs: [
162 "libutils",
163 "libcutils",
164 "liblog",
165 ],
166 },
167 android: {
168 shared_libs: [
169 "libLLVM",
170 "libdl",
171 "libutils",
172 "libcutils",
173 "liblog",
174 ],
175 },
176 },
177
178 product_variables: {
179 unbundled_build: {
180 // Don't build in unbundled branches
181 enabled: false,
182 },
183 },
184}
185
186subdirs = [
187 "bcinfo",
188 "lib",
189 "tools",
190]