• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Mesa 3-D graphics library
2//
3// Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
4// Copyright (C) 2010-2011 LunarG Inc.
5//
6// Permission is hereby granted, free of charge, to any person obtaining a
7// copy of this software and associated documentation files (the "Software"),
8// to deal in the Software without restriction, including without limitation
9// the rights to use, copy, modify, merge, publish, distribute, sublicense,
10// and/or sell copies of the Software, and to permit persons to whom the
11// Software is furnished to do so, subject to the following conditions:
12//
13// The above copyright notice and this permission notice shall be included
14// in all copies or substantial portions of the Software.
15//
16// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22// DEALINGS IN THE SOFTWARE.
23
24soong_namespace {}
25
26// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
27//     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
28//     DEPENDING ON IT IN YOUR PROJECT. ***
29package {
30    default_applicable_licenses: ["external_mesa3d_license"],
31}
32
33// Added automatically by a large-scale-change that took the approach of
34// 'apply every license found to every target'. While this makes sure we respect
35// every license restriction, it may not be entirely correct.
36//
37// e.g. GPL in an MIT project might only apply to the contrib/ directory.
38//
39// Please consider splitting the single license below into multiple licenses,
40// taking care not to lose any license_kind information, and overriding the
41// default license using the 'licenses: [...]' property on targets as needed.
42//
43// For unused files, consider creating a 'fileGroup' with "//visibility:private"
44// to attach the license to, and including a comment whether the files may be
45// used in the current project.
46// See: http://go/android-license-faq
47license {
48    name: "external_mesa3d_license",
49    visibility: [":__subpackages__"],
50    license_kinds: [
51        "SPDX-license-identifier-Apache-2.0",
52        "SPDX-license-identifier-BSD",
53        "SPDX-license-identifier-BSL-1.0",
54        "SPDX-license-identifier-GPL",
55        "SPDX-license-identifier-GPL-2.0",
56        "SPDX-license-identifier-ISC",
57        "SPDX-license-identifier-MIT",
58        "SPDX-license-identifier-Unlicense",
59        "legacy_by_exception_only", // by exception only
60        "legacy_notice",
61        "legacy_unencumbered",
62    ],
63    license_text: [
64        "LICENSE",
65    ],
66}
67
68build = ["Android.gen.bp"]
69
70cc_library_headers {
71    name: "mesa_common_headers",
72    export_include_dirs: [
73        "src",
74        "include",
75    ],
76    host_supported: true,
77    vendor: true,
78    visibility: [":__subpackages__"],
79}
80
81// This needs to be kept in sync with Android.common.mk
82cc_defaults {
83    name: "mesa_common_defaults",
84    defaults: ["mesa_version_defaults"],
85
86    // uncomment to keep the debug symbols
87    // strip: { none: true, },
88
89    vendor: true,
90    header_libs: ["mesa_common_headers"],
91
92    cflags: [
93        "-Wno-error",
94        "-Werror=incompatible-pointer-types",
95        "-Wno-unused-parameter",
96        "-Wno-pointer-arith",
97        "-Wno-missing-field-initializers",
98        "-Wno-initializer-overrides",
99        "-Wno-mismatched-tags",
100        // PACKAGE_VERSION is in mesa_version_defaults
101        "-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"",
102
103        // XXX: The following __STDC_*_MACROS defines should not be needed.
104        // It's likely due to a bug elsewhere, but let's temporarily add them
105        // here to fix the radeonsi build.
106        "-DENABLE_SHADER_CACHE",
107        "-D__STDC_CONSTANT_MACROS",
108        "-D__STDC_LIMIT_MACROS",
109        "-DHAVE___BUILTIN_EXPECT",
110        "-DHAVE___BUILTIN_FFS",
111        "-DHAVE___BUILTIN_FFSLL",
112        "-DHAVE_DLFCN_H",
113        "-DHAVE_FUNC_ATTRIBUTE_FLATTEN",
114        "-DHAVE_FUNC_ATTRIBUTE_UNUSED",
115        "-DHAVE_FUNC_ATTRIBUTE_FORMAT",
116        "-DHAVE_FUNC_ATTRIBUTE_PACKED",
117        "-DHAVE_FUNC_ATTRIBUTE_ALIAS",
118        "-DHAVE_FUNC_ATTRIBUTE_NORETURN",
119        "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL",
120        "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT",
121        "-DHAVE___BUILTIN_CTZ",
122        "-DHAVE___BUILTIN_POPCOUNT",
123        "-DHAVE___BUILTIN_POPCOUNTLL",
124        "-DHAVE___BUILTIN_CLZ",
125        "-DHAVE___BUILTIN_CLZLL",
126        "-DHAVE___BUILTIN_UNREACHABLE",
127        "-DHAVE_PTHREAD=1",
128        "-DHAVE_DLADDR",
129        "-DHAVE_DL_ITERATE_PHDR",
130        "-DHAVE_LINUX_FUTEX_H",
131        "-DHAVE_ENDIAN_H",
132        "-DHAVE_ZLIB",
133        "-DMAJOR_IN_SYSMACROS",
134        "-DVK_USE_PLATFORM_ANDROID_KHR",
135        "-fvisibility=hidden",
136        "-fno-math-errno",
137        "-fno-trapping-math",
138        "-Werror",
139        "-Wno-#warnings",
140        "-Wno-asm-operand-widths",
141        "-Wno-cast-calling-convention",
142        "-Wno-constant-logical-operand",
143        "-Wno-enum-conversion",
144        "-Wno-format",
145        "-Wno-gnu-variable-sized-type-not-at-end",
146        "-Wno-implicit-fallthrough",
147        "-Wno-incompatible-pointer-types",
148        "-Wno-missing-braces",
149        "-Wno-overloaded-virtual",
150        "-Wno-self-assign",
151        "-Wno-shift-negative-value",
152        "-Wno-sign-compare",
153        "-Wno-sometimes-uninitialized",
154        "-Wno-switch",
155        "-Wno-typedef-redefinition",
156        "-Wno-uninitialized",
157        "-DHAVE_TIMESPEC_GET",
158    ],
159
160    // mesa requires at least c99 compiler
161    c_std: "c99",
162
163    cppflags: [
164        "-D__STDC_CONSTANT_MACROS",
165        "-D__STDC_FORMAT_MACROS",
166        "-D__STDC_LIMIT_MACROS",
167        "-Wno-error=non-virtual-dtor",
168        "-Wno-non-virtual-dtor",
169    ],
170
171    arch: {
172        arm: {
173            neon: {
174                cflags: ["-DUSE_ARM_ASM"],
175            },
176        },
177        arm64: {
178            cflags: ["-DUSE_AARCH64_ASM"],
179        },
180    },
181
182    multilib: {
183        lib32: {
184            cflags: ["-DDEFAULT_DRIVER_DIR=\"/vendor/lib/dri\""],
185        },
186        lib64: {
187            cflags: ["-DDEFAULT_DRIVER_DIR=\"/vendor/lib64/dri\""],
188        },
189    },
190
191    product_variables: {
192        platform_sdk_version: {
193            cflags: ["-DANDROID_API_LEVEL=%d"],
194        },
195    },
196
197    target: {
198        host: {
199            cflags: [
200                "-D_GNU_SOURCE",
201                "-DHAVE_LIBDRM",
202            ],
203            shared_libs: ["libdrm"],
204        },
205    },
206}
207