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 26build = ["Android.gen.bp"] 27 28cc_library_headers { 29 name: "mesa_common_headers", 30 export_include_dirs: [ 31 "src", 32 "include", 33 ], 34 host_supported: true, 35 vendor: true, 36 visibility: [":__subpackages__"], 37} 38 39// This needs to be kept in sync with Android.common.mk 40cc_defaults { 41 name: "mesa_common_defaults", 42 defaults: ["mesa_version_defaults"], 43 44 // uncomment to keep the debug symbols 45 // strip: { none: true, }, 46 47 vendor: true, 48 header_libs: ["mesa_common_headers"], 49 50 cflags: [ 51 "-Wno-error", 52 "-Werror=incompatible-pointer-types", 53 "-Wno-unused-parameter", 54 "-Wno-pointer-arith", 55 "-Wno-missing-field-initializers", 56 "-Wno-initializer-overrides", 57 "-Wno-mismatched-tags", 58 // PACKAGE_VERSION is in mesa_version_defaults 59 "-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"", 60 61 // XXX: The following __STDC_*_MACROS defines should not be needed. 62 // It's likely due to a bug elsewhere, but let's temporarily add them 63 // here to fix the radeonsi build. 64 "-DENABLE_SHADER_CACHE", 65 "-D__STDC_CONSTANT_MACROS", 66 "-D__STDC_LIMIT_MACROS", 67 "-DHAVE___BUILTIN_EXPECT", 68 "-DHAVE___BUILTIN_FFS", 69 "-DHAVE___BUILTIN_FFSLL", 70 "-DHAVE_DLFCN_H", 71 "-DHAVE_FUNC_ATTRIBUTE_FLATTEN", 72 "-DHAVE_FUNC_ATTRIBUTE_UNUSED", 73 "-DHAVE_FUNC_ATTRIBUTE_FORMAT", 74 "-DHAVE_FUNC_ATTRIBUTE_PACKED", 75 "-DHAVE_FUNC_ATTRIBUTE_ALIAS", 76 "-DHAVE_FUNC_ATTRIBUTE_NORETURN", 77 "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL", 78 "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", 79 "-DHAVE___BUILTIN_CTZ", 80 "-DHAVE___BUILTIN_POPCOUNT", 81 "-DHAVE___BUILTIN_POPCOUNTLL", 82 "-DHAVE___BUILTIN_CLZ", 83 "-DHAVE___BUILTIN_CLZLL", 84 "-DHAVE___BUILTIN_UNREACHABLE", 85 "-DHAVE_PTHREAD=1", 86 "-DHAVE_DLADDR", 87 "-DHAVE_DL_ITERATE_PHDR", 88 "-DHAVE_LINUX_FUTEX_H", 89 "-DHAVE_ENDIAN_H", 90 "-DHAVE_ZLIB", 91 "-DMAJOR_IN_SYSMACROS", 92 "-DVK_USE_PLATFORM_ANDROID_KHR", 93 "-fvisibility=hidden", 94 "-fno-math-errno", 95 "-fno-trapping-math", 96 "-Werror", 97 "-Wno-#warnings", 98 "-Wno-asm-operand-widths", 99 "-Wno-cast-calling-convention", 100 "-Wno-constant-logical-operand", 101 "-Wno-enum-conversion", 102 "-Wno-format", 103 "-Wno-gnu-variable-sized-type-not-at-end", 104 "-Wno-implicit-fallthrough", 105 "-Wno-incompatible-pointer-types", 106 "-Wno-missing-braces", 107 "-Wno-overloaded-virtual", 108 "-Wno-self-assign", 109 "-Wno-shift-negative-value", 110 "-Wno-sign-compare", 111 "-Wno-sometimes-uninitialized", 112 "-Wno-switch", 113 "-Wno-typedef-redefinition", 114 "-Wno-uninitialized", 115 "-DHAVE_TIMESPEC_GET", 116 ], 117 118 // mesa requires at least c99 compiler 119 c_std: "c99", 120 121 cppflags: [ 122 "-D__STDC_CONSTANT_MACROS", 123 "-D__STDC_FORMAT_MACROS", 124 "-D__STDC_LIMIT_MACROS", 125 "-Wno-error=non-virtual-dtor", 126 "-Wno-non-virtual-dtor", 127 ], 128 129 arch: { 130 arm: { 131 neon: { 132 cflags: ["-DUSE_ARM_ASM"], 133 }, 134 }, 135 arm64: { 136 cflags: ["-DUSE_AARCH64_ASM"], 137 }, 138 }, 139 140 multilib: { 141 lib32: { 142 cflags: ["-DDEFAULT_DRIVER_DIR=\"/vendor/lib/dri\""], 143 }, 144 lib64: { 145 cflags: ["-DDEFAULT_DRIVER_DIR=\"/vendor/lib64/dri\""], 146 }, 147 }, 148 149 product_variables: { 150 platform_sdk_version: { 151 cflags: ["-DANDROID_API_LEVEL=%d"], 152 }, 153 }, 154 155 target: { 156 host: { 157 cflags: [ 158 "-D_GNU_SOURCE", 159 "-DHAVE_LIBDRM", 160 ], 161 shared_libs: ["libdrm"], 162 }, 163 }, 164} 165