blob: 2ab6fb710ba737ca37dbb179397ea234c07ce1ea [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/gallium/auxiliary/",
"$mesa_build_root/src/gallium/include/",
]
}
mesa_source_set("headers") {
public_configs = [ ":util_public_config" ]
sources = [
"bitset.h",
"build_id.h",
"debug.h",
"fast_idiv_by_const.h",
"format_srgb.h",
"futex.h",
"half_float.h",
"hash_table.h",
"inflight_list.h",
"list.h",
"macros.h",
"mesa-sha1.h",
"os_dirent.h",
"os_file.h",
"os_time.h",
"ralloc.h",
"register_allocate.h",
"rgtc.h",
"rounding.h",
"set.h",
"sha1/sha1.h",
"simple_list.h",
"strndup.h",
"strtod.h",
"texcompress_rgtc_tmp.h",
"u_atomic.h",
"u_vector.h",
"vma.h",
]
}
mesa_source_set("util") {
include_dirs = [
"$mesa_build_root/src/util",
"$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",
"$magma_build_root/include:magma_abi",
]
public_configs = [ ":util_public_config" ]
sources = [
"anon_file.h",
"build_id.c",
"debug.c",
"fast_idiv_by_const.c",
"half_float.c",
"hash_table.c",
"inflight_list.c",
"mesa-sha1.c",
"os_file.c",
"os_time.c",
"ralloc.c",
"register_allocate.c",
"rgtc.c",
"set.c",
"sha1/sha1.c",
"strtod.c",
"u_vector.c",
"vma.c",
]
deps = []
if (current_os == "fuchsia") {
sources += [
"futex_fuchsia.c",
"os_dirent_fuchsia.cpp",
]
deps += [
"$mesa_build_root/src/os",
"//zircon/public/lib/zx",
"//zircon/public/lib/zxio",
]
} else {
sources += [ "anon_file.c" ]
}
}
action("format_srgb") {
output_name = "format_srgb.c"
script_name = "format_srgb.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
script_name,
]
args = [
"$magma_python_path",
rebase_path(target_gen_dir) + "/$output_name",
rebase_path(".") + "/$script_name",
]
}
config("gen_public_config") {
include_dirs = [ target_gen_dir ]
}
mesa_source_set("gen") {
public_configs = [ ":gen_public_config" ]
deps = [
":format_srgb",
"$mesa_build_root/include:c_compat",
]
include_dirs = [ "." ]
sources = [
"$target_gen_dir/format_srgb.c",
]
}