| #!/bin/bash |
| |
| # Copyright 2016 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. |
| |
| set -e |
| root_out_dir=${1} |
| fuchsia_root=$root_out_dir/../.. |
| tools_path=$fuchsia_root/buildtools |
| build_dir=$root_out_dir/build-vulkancts |
| caselist_build_dir=$root_out_dir/build-vulkancts/cases-build |
| caselist_out_dir=$root_out_dir/build-vulkancts/cases |
| sysroot=$root_out_dir/sdks/zircon_sysroot/sysroot |
| |
| if [ ! -d "$sysroot" ]; then |
| echo "Can't find sysroot: $sysroot" |
| exit 1 |
| fi |
| |
| if [[ $root_out_dir == *"arm64" ]]; then |
| fuchsia_lib_path=$root_out_dir/arm64-shared |
| extra_args="-DFUCHSIA_SYSTEM_PROCESSOR=aarch64 -DDE_CPU=DE_CPU_ARM_64 -DDE_PTR_SIZE=8" |
| else |
| fuchsia_lib_path=$root_out_dir/x64-shared |
| extra_args="-DFUCHSIA_SYSTEM_PROCESSOR=x86_64" |
| fi |
| |
| pushd $fuchsia_root/third_party/vulkan-cts |
| python external/fetch_sources.py |
| popd |
| |
| # builds the test executable for the host in order to write out test cases |
| pushd $fuchsia_root/third_party/vulkan-cts |
| mkdir -p $caselist_out_dir |
| mkdir -p $caselist_build_dir |
| python scripts/build_caselists.py -b $caselist_build_dir -m dEQP-VK $caselist_out_dir |
| popd |
| |
| mkdir -p $build_dir |
| $fuchsia_root/third_party/vulkan-cts/fuchsia/gendepsfile.py $build_dir/vulkan-cts.d $fuchsia_root/third_party/vulkan-cts |
| pushd $build_dir |
| cmake $fuchsia_root/third_party/vulkan-cts -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=$tools_path/ninja -DFUCHSIA_SYSROOT=$sysroot -DCMAKE_TOOLCHAIN_FILE=$fuchsia_root/build/Fuchsia.cmake -DDE_OS=DE_OS_FUCHSIA -DDEQP_TARGET=fuchsia -DFUCHSIA_ROOT=$fuchsia_root -DFUCHSIA_LIB_DIR=$fuchsia_lib_path $extra_args |
| $tools_path/ninja |
| popd |