blob: 8a9c40d5f6f8e5ae91d0b860f24941c6bdde3027 [file] [log] [blame]
# Copyright 2016 Google, LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
import("../../mesa.gni")
config("util_public_config") {
include_dirs = [
"$mesa_build_root/src",
"$mesa_build_root/src/util",
"$mesa_build_root/src/gallium/auxiliary/",
"$mesa_build_root/src/gallium/include/",
]
}
config("build_config") {
include_dirs = [
"$mesa_build_root/src/gallium/include/",
"$mesa_build_root/src/",
]
}
mesa_source_set("headers") {
public_configs = [ ":util_public_config" ]
sources = [
"bitset.h",
"blob.h",
"build_id.h",
"debug.h",
"double.h",
"fast_idiv_by_const.h",
"format_srgb.h",
"futex.h",
"half_float.h",
"hash_table.h",
"list.h",
"log.h",
"macros.h",
"memstream.h",
"mesa-sha1.h",
"os_dirent.h",
"os_file.h",
"os_misc.h",
"os_time.h",
"perf/u_trace.h",
"perf/u_trace_priv.h",
"ralloc.h",
"register_allocate.h",
"rgtc.h",
"rounding.h",
"set.h",
"sha1/sha1.h",
"simple_list.h",
"softfloat.h",
"sparse_array.h",
"strndup.h",
"strtod.h",
"texcompress_rgtc_tmp.h",
"u_atomic.h",
"u_cpu_detect.h",
"u_debug.h",
"u_printf.h",
"u_process.h",
"u_queue.h",
"u_thread.h",
"u_vector.h",
"u_worklist.h",
"vma.h",
]
configs = [ "//build/config:Wno-conversion" ]
}
mesa_source_set("util") {
include_dirs = [
"$mesa_build_root/src/mesa/",
"$mesa_build_root/src/mapi/",
"$mesa_build_root/src/gallium/auxiliary/",
]
public_deps = [
":gen",
":headers",
"$mesa_build_root/include:c_compat",
]
public_configs = [ ":util_public_config" ]
sources = [
"bigmath.h",
"bitscan.c",
"bitscan.h",
"bitset.h",
"blob.c",
"blob.h",
"build_id.c",
"build_id.h",
"cnd_monotonic.h",
"compiler.h",
"compress.c",
"compress.h",
"crc32.c",
"crc32.h",
"dag.c",
"disk_cache.c",
"disk_cache.h",
"disk_cache_os.c",
"disk_cache_os.h",
"double.c",
"double.h",
"enum_operators.h",
"fast_idiv_by_const.c",
"fast_idiv_by_const.h",
"format_r11g11b10f.h",
"format_rgb9e5.h",
"format_srgb.h",
"fossilize_db.c",
"fossilize_db.h",
"futex.h",
"half_float.c",
"half_float.h",
"hash_table.c",
"hash_table.h",
"list.h",
"log.c",
"macros.h",
"memstream.c",
"memstream.h",
"mesa-sha1.c",
"mesa-sha1.h",
"mesa_cache_db.c",
"mesa_cache_db.h",
"os_file.c",
"os_memory_fd.c",
"os_misc.c",
"os_misc.h",
"os_socket.c",
"os_socket.h",
"os_time.c",
"os_time.h",
"perf/u_trace.c",
"perf/u_trace.h",
"perf/u_trace_priv.h",
"ptralloc.h",
"ralloc.c",
"ralloc.h",
"rand_xor.c",
"rand_xor.h",
"rb_tree.c",
"rb_tree.h",
"register_allocate.c",
"register_allocate.h",
"rgtc.c",
"rgtc.h",
"rounding.h",
"rwlock.c",
"rwlock.h",
"set.c",
"set.h",
"sha1/sha1.c",
"sha1/sha1.h",
"simple_mtx.c",
"simple_mtx.h",
"slab.c",
"slab.h",
"softfloat.c",
"softfloat.h",
"sparse_array.c",
"sparse_array.h",
"string_buffer.c",
"string_buffer.h",
"strndup.h",
"strtod.c",
"strtod.h",
"texcompress_rgtc_tmp.h",
"timespec.h",
"u_atomic.c",
"u_atomic.h",
"u_call_once.c",
"u_call_once.h",
"u_cpu_detect.c",
"u_cpu_detect.h",
"u_debug.c",
"u_debug.h",
"u_debug_describe.c",
"u_debug_describe.h",
"u_debug_memory.c",
"u_debug_refcnt.c",
"u_debug_refcnt.h",
"u_dl.c",
"u_dl.h",
"u_dynarray.h",
"u_endian.h",
"u_fifo.h",
"u_hash_table.c",
"u_hash_table.h",
"u_idalloc.c",
"u_idalloc.h",
"u_math.c",
"u_math.h",
"u_memset.h",
"u_mm.c",
"u_mm.h",
# TODO(b/301509045): enable Perfetto support.
# "u_perfetto.c",
# "u_perfetto.h",
"u_pointer.h",
"u_printf.c",
"u_printf.h",
"u_process.c",
"u_process.h",
"u_qsort.cpp",
"u_qsort.h",
"u_queue.c",
"u_queue.h",
"u_string.h",
"u_thread.c",
"u_thread.h",
"u_vector.c",
"u_vector.h",
"u_worklist.c",
"u_worklist.h",
"vl_rbsp.h",
"vl_vlc.h",
"vma.c",
"vma.h",
"xxhash.h",
]
deps = [ "$mesa_build_root/src/c11" ]
if (current_os == "fuchsia") {
sources += [
"futex_fuchsia.c",
"os_dirent_fuchsia.cpp",
]
deps += [
"//sdk/lib/syslog/structured_backend",
"//sdk/lib/zxio",
"//zircon/system/ulib/zx",
]
} else {
if (current_os == "linux") {
sources += [ "futex.c" ]
}
sources += [
"anon_file.c",
"anon_file.h",
]
}
# Would need to do something different for Android. See meson.build
sources += [
"u_debug_stack.c",
"u_debug_symbol.c",
"u_debug_symbol.h",
]
configs = [
":build_config",
"//build/config:Wno-conversion",
"//build/config:Wno-strict-prototypes",
]
}
mesa_source_set("magma_util") {
public_deps = [
":util",
"$mesa_build_root/src/os",
"$mesa_build_root/src/util/magma",
]
defines = [ "USE_MAGMA=1" ]
public_configs = [ ":util_public_config" ]
}
mesa_source_set("zircon_util") {
public_deps = [
":util",
"$mesa_build_root/src/os:zircon_os",
]
public_configs = [ ":util_public_config" ]
}
mesa_source_set("xmlconfig") {
sources = [
"xmlconfig.c",
"xmlconfig.h",
]
deps = [
":gen",
"//third_party/expat",
]
configs = [ ":util_public_config" ]
}
mesa_python_stdout_to_file_action("format_srgb") {
output = "format_srgb.c"
script = "format_srgb.py"
}
mesa_python_action("driconf_static") {
output_name = "driconf_static.h"
script = "driconf_static.py"
inputs = [ "00-mesa-defaults.conf" ]
outputs = [ "$target_gen_dir/$output_name" ]
args = [
rebase_path(".") + "/00-mesa-defaults.conf",
rebase_path(target_gen_dir, root_build_dir) + "/$output_name",
]
}
config("gen_public_config") {
include_dirs = [ target_gen_dir ]
}
mesa_source_set("gen") {
public_configs = [ ":gen_public_config" ]
deps = [
":driconf_static",
":format_srgb",
"$mesa_build_root/include:c_compat",
]
include_dirs = [ "." ]
sources = [ "$target_gen_dir/format_srgb.c" ]
configs = [
":build_config",
"//build/config:Wno-conversion",
]
}