blob: 7decf2489642ee6fd13f4cb54f09a30f9835cc5d [file] [log] [blame]
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
import("//build/build_id.gni")
import("//build/components.gni")
declare_args() {
intel_media_driver_debug = is_debug
}
va_install_root = "$root_build_dir/build-intel-media-driver/install"
config("va-config") {
include_dirs = [ "$va_install_root/include" ]
libs = [ "$va_install_root/strip/libva.so.2" ]
}
resource("libva-resource") {
sources = [ "$va_install_root/strip/libva.so.2" ]
outputs = [ "lib/libva.so.2" ]
}
group("va") {
public_configs = [ ":va-config" ]
public_deps = [ ":libva-resource" ]
}
config("va-magma-config") {
include_dirs = [ "$va_install_root/include" ]
libs = [ "$va_install_root/strip/libva-magma.so.2" ]
}
resource("libva-magma-resource") {
sources = [ "$va_install_root/strip/libva-magma.so.2" ]
outputs = [ "lib/libva-magma.so.2" ]
}
group("va-magma") {
public_configs = [ ":va-magma-config" ]
public_deps = [
":libva-magma-resource",
"//src/graphics/lib/magma/include:magma",
]
}
resource("gmmlib-resource") {
sources = [ "$va_install_root/strip/libigdgmm.so.11" ]
outputs = [ "lib/libigdgmm.so.11" ]
}
resource("va-intel-resource") {
sources = [ "$va_install_root/strip/iHD_drv_video.so" ]
outputs = [ "lib/iHD_drv_video.so" ]
}
# Only have a copy of the action in one toolchain.
if (current_toolchain == default_toolchain) {
action("out-of-tree-build") {
script = "build.sh"
outputs = [
"$va_install_root/strip/libva.so.2",
"$va_install_root/strip/libva-magma.so.2",
"$va_install_root/strip/libigdgmm.so.11",
"$va_install_root/strip/iHD_drv_video.so",
"$va_install_root/strip/libva.so.2.debug",
"$va_install_root/strip/libva-magma.so.2.debug",
"$va_install_root/strip/libigdgmm.so.11.debug",
"$va_install_root/strip/iHD_drv_video.so.debug",
]
fuchsia_dir = rebase_path("$root_build_dir/../..")
fuchsia_out_dir = rebase_path(root_out_dir)
args = [
fuchsia_dir,
fuchsia_out_dir,
]
if (intel_media_driver_debug) {
args += [ "debug" ]
} else {
args += [ "release" ]
}
deps = [
"//sdk:zircon_sysroot_export",
"//src/graphics/lib/magma/src/libmagma:libmagma_complete($shlib_toolchain)",
]
depfile = "$root_out_dir/build-intel-media-driver/media-driver.d"
no_output_dir_leaks = false
}
build_id_entry("libva_build_id") {
stripped = "$va_install_root/strip/libva.so.2"
debug = "$va_install_root/strip/libva.so.2.debug"
deps = [ ":out-of-tree-build" ]
}
build_id_entry("libva_magma_build_id") {
stripped = "$va_install_root/strip/libva-magma.so.2"
debug = "$va_install_root/strip/libva-magma.so.2.debug"
deps = [ ":out-of-tree-build" ]
}
build_id_entry("libigdgmm_build_id") {
stripped = "$va_install_root/strip/libigdgmm.so.11"
debug = "$va_install_root/strip/libigdgmm.so.11.debug"
deps = [ ":out-of-tree-build" ]
}
build_id_entry("iHD_build_id") {
stripped = "$va_install_root/strip/iHD_drv_video.so"
debug = "$va_install_root/strip/iHD_drv_video.so.debug"
deps = [ ":out-of-tree-build" ]
}
}
group("va-intel") {
public_deps = [
":gmmlib-resource",
":va",
":va-intel-resource",
":va-magma",
]
deps = [
":iHD_build_id($default_toolchain)",
":libigdgmm_build_id($default_toolchain)",
":libva_build_id($default_toolchain)",
":libva_magma_build_id($default_toolchain)",
":out-of-tree-build($default_toolchain)",
]
}
executable("codec_runner_intel_gen_exe") {
output_name = "codec_runner_intel_gen"
sources = [ "main.cc" ]
deps = [
":va-intel",
"//src/graphics/lib/magma/src/libmagma",
"//src/media/codec/codecs/vaapi:codec_runner_vaapi",
]
}
fuchsia_package_with_single_component("codec_runner_intel_gen") {
manifest = "meta/codec_runner_intel_gen.cml"
deps = [ ":codec_runner_intel_gen_exe" ]
}
fuchsia_package_archive("codec_runner_intel_gen_archive") {
package = ":codec_runner_intel_gen"
}