| # Copyright 2018 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 os |
| import subprocess |
| |
| out_file = open("BUILD.gn", "w") |
| |
| out_file.write("""\ |
| ### NOTE: This file auto-generated from gen.py |
| |
| import("//build/package.gni") |
| |
| action("build") { |
| script = "build.sh" |
| args = [ rebase_path(root_out_dir) ] |
| deps = [ |
| "//third_party/vulkan_loader_and_validation_layers:vulkan", |
| "//garnet/public/sdk:zircon_sysroot", |
| ] |
| |
| depfile = "$root_out_dir/build-vulkancts/vulkan-cts.d" |
| outputs = [ "$root_out_dir/build-vulkancts/external/vulkancts/modules/vulkan/deqp-vk" ] |
| } |
| |
| copy("copy") { |
| sources = [ "$root_out_dir/build-vulkancts/external/vulkancts/modules/vulkan/deqp-vk" ] |
| outputs = [ "$root_build_dir/deqp-vk" ] |
| deps = [ ":build" ] |
| } |
| |
| package("vulkan-cts") { |
| deps = [ ":copy" ] |
| binary = "deqp-vk" |
| meta = [ { |
| path = rebase_path("meta/sandbox") |
| dest = "sandbox" |
| } ] |
| resources = [ |
| { |
| path=rebase_path("../external/vulkancts/mustpass/1.0.2/vk-default.txt") |
| dest="vk-default.txt" |
| }, |
| """) |
| |
| files = subprocess.check_output(["find", "../external/vulkancts/data/vulkan", "-type", "f"]) |
| file_lines = files.splitlines() |
| |
| for file in file_lines: |
| file_split = file.split('/') |
| file_split = file_split[4:] |
| out_file.write(' {\n') |
| out_file.write(' path=rebase_path("%s")\n' % file) |
| out_file.write(' dest="%s"\n' % '/'.join(file_split)) |
| out_file.write(' },\n') |
| |
| out_file.write(' ]\n') |
| out_file.write('}\n') |
| out_file.close() |