| # 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/components.gni") |
| |
| declare_args() { |
| intel_media_driver_debug = is_debug |
| } |
| |
| va_install_root = "$root_out_dir/build-intel-media-driver/install" |
| |
| config("va-config") { |
| include_dirs = [ "$va_install_root/include" ] |
| libs = [ "$va_install_root/lib/libva.so.2" ] |
| } |
| |
| resource("libva-resource") { |
| sources = [ "$va_install_root/lib/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/lib/libva-magma.so.2" ] |
| } |
| |
| resource("libva-magma-resource") { |
| sources = [ "$va_install_root/lib/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_abi", |
| ] |
| } |
| |
| resource("gmmlib-resource") { |
| sources = [ "$va_install_root/lib/libigdgmm.so.11" ] |
| outputs = [ "lib/libigdgmm.so.11" ] |
| } |
| |
| resource("va-intel-resource") { |
| sources = [ "$va_install_root/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/lib/libva.so.2", |
| "$va_install_root/lib/libva-magma.so.2", |
| "$va_install_root/lib/libigdgmm.so.11", |
| "$va_install_root/iHD_drv_video.so", |
| |
| # Placeholder is here just to force an incremental build |
| "$va_install_root/place_holder", |
| ] |
| |
| 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", |
| ] |
| } |
| } |
| |
| group("va-intel") { |
| public_deps = [ |
| ":gmmlib-resource", |
| ":va", |
| ":va-intel-resource", |
| ":va-magma", |
| ] |
| deps = [ ":out-of-tree-build" ] |
| } |