Bug 1797755 - Part 5: Use a single initial mark stack size regardless of whether...
[gecko.git] / third_party / aom / test / test_data_download_worker.cmake
blobdc803497dadf3e6a90b6132b4d7c006418fbdfc6
2 # Copyright (c) 2017, Alliance for Open Media. All rights reserved
4 # This source code is subject to the terms of the BSD 2 Clause License and the
5 # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was
6 # not distributed with this source code in the LICENSE file, you can obtain it
7 # at www.aomedia.org/license/software. If the Alliance for Open Media Patent
8 # License 1.0 was not distributed with this source code in the PATENTS file, you
9 # can obtain it at www.aomedia.org/license/patent.
11 include("${AOM_ROOT}/test/test_data_util.cmake")
13 # https://github.com/cheshirekow/cmake_format/issues/34
14 # cmake-format: off
15 if (NOT AOM_ROOT OR NOT AOM_CONFIG_DIR OR NOT AOM_TEST_FILE
16     OR NOT AOM_TEST_CHECKSUM)
17   message(FATAL_ERROR
18           "AOM_ROOT, AOM_CONFIG_DIR, AOM_TEST_FILE and AOM_TEST_CHECKSUM must be
19           defined.")
20 endif ()
21 # cmake-format: on
23 set(AOM_TEST_DATA_URL "http://storage.googleapis.com/aom-test-data")
25 if(NOT AOM_TEST_DATA_PATH)
26   set(AOM_TEST_DATA_PATH "$ENV{LIBAOM_TEST_DATA_PATH}")
27 endif()
29 if("${AOM_TEST_DATA_PATH}" STREQUAL "")
30   message(WARNING
31             "Writing test data to ${AOM_CONFIG_DIR}, set "
32             "$LIBAOM_TEST_DATA_PATH in your environment to avoid this warning.")
33   set(AOM_TEST_DATA_PATH "${AOM_CONFIG_DIR}")
34 endif()
36 if(NOT EXISTS "${AOM_TEST_DATA_PATH}")
37   file(MAKE_DIRECTORY "${AOM_TEST_DATA_PATH}")
38 endif()
40 expand_test_file_paths("AOM_TEST_FILE" "${AOM_TEST_DATA_PATH}" "filepath")
41 expand_test_file_paths("AOM_TEST_FILE" "${AOM_TEST_DATA_URL}" "url")
43 check_file("${filepath}" "${AOM_TEST_CHECKSUM}" "needs_download")
44 if(needs_download)
45   download_test_file("${url}" "${AOM_TEST_CHECKSUM}" "${filepath}")
46 endif()