1# Copyright 2024 Google, LLC
2#
3# Permission is hereby granted, free of charge, to any person obtaining a
4# copy of this software and associated documentation files (the "Software"),
5# to deal in the Software without restriction, including without limitation
6# the rights to use, copy, modify, merge, publish, distribute, sublicense,
7# and/or sell copies of the Software, and to permit persons to whom the
8# Software is furnished to do so, subject to the following conditions:
9#
10# The above copyright notice and this permission notice (including the next
11# paragraph) shall be included in all copies or substantial portions of the
12# Software.
13#
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20# IN THE SOFTWARE.
21
22import("../mesa.gni")
23
24config("common_config") {
25  # Version file not present
26  mesa_version = "unknown"
27
28  defines = [
29    # Pretend to be Linux for now so we avoid the need to
30    # introduce DETECT_OS_FUCHSIA into mesa.
31    "DETECT_OS_LINUX=1",
32    "DETECT_OS_UNIX=1",
33    "HAVE_PROGRAM_INVOCATION_NAME=1",
34    "HAVE_ENDIAN_H=1",
35    "HAVE_PTHREAD=1",
36    "HAVE_STRUCT_TIMESPEC=1",
37    "HAVE_TIMESPEC_GET=1",
38    "HAVE_UNISTD_H=1",
39    "HAVE_DLFCN_H=1",
40    "HAVE___BUILTIN_BSWAP32=1",
41    "HAVE___BUILTIN_BSWAP64=1",
42    "HAVE___BUILTIN_CLZ=1",
43    "HAVE___BUILTIN_CLZLL=1",
44    "HAVE___BUILTIN_CTZ=1",
45    "HAVE___BUILTIN_EXPECT=1",
46    "HAVE___BUILTIN_FFS=1",
47    "HAVE___BUILTIN_FFSLL=1",
48    "HAVE___BUILTIN_POPCOUNT=1",
49    "HAVE___BUILTIN_POPCOUNTLL=1",
50    "HAVE___BUILTIN_UNREACHABLE=1",
51    "HAVE_FUNC_ATTRIBUTE_CONST=1",
52    "HAVE_FUNC_ATTRIBUTE_FLATTEN=1",
53    "HAVE_FUNC_ATTRIBUTE_FORMAT=1",
54    "HAVE_FUNC_ATTRIBUTE_MALLOC=1",
55    "HAVE_FUNC_ATTRIBUTE_PACKED=1",
56    "HAVE_FUNC_ATTRIBUTE_PURE=1",
57    "HAVE_FUNC_ATTRIBUTE_UNUSED=1",
58    "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1",
59    "HAVE_FUNC_ATTRIBUTE_NORETURN=1",
60    "HAVE_DLADDR=1",
61    "HAVE_DL_ITERATE_PHDR=1",
62    "PACKAGE_VERSION=\"$mesa_version\" ",
63    "_DEFAULT_SOURCE",
64    "_GNU_SOURCE=1",
65  ]
66
67  if (is_debug) {
68    defines += [ "DEBUG=1" ]
69  }
70
71  cflags = [
72    "-Wno-sign-compare",
73    "-Wno-unused-function",
74    "-Wno-extra-semi",
75    "-Wno-newline-eof",
76    "-Wno-tautological-constant-out-of-range-compare",
77    "-Wno-unknown-pragmas",
78    "-Wno-int-in-bool-context",
79    "-Wno-conversion",
80    "-Wno-deprecated-anon-enum-enum-conversion",
81    "-Wno-strict-prototypes",
82  ]
83}
84