dawn-cmake/scripts/dawn_overrides_with_defaults.gni
Loko Kung 7d2b9d9e83 Add alternative method to use a version/git hash from a file.
- This is necessary for Chromium builds from tarballs where git is no longer available. This gives Chromium another option to create the version file when creating the tarball to accomplish the same thing.

Bug: dawn:549
Change-Id: Iffb4bf694b0df1306dd92939353422e5115346a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94043
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-06-22 04:19:43 +00:00

92 lines
2.5 KiB
Plaintext

# Copyright 2018 The Dawn Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This files imports the overrides for Dawn but sets the defaults so that
# projects including Dawn don't have to set dirs if they happen to use the
# same.
# It takes advantage of GN's variable scoping rules to define global variables
# inside if constructs.
import("//build_overrides/dawn.gni")
if (!defined(dawn_standalone)) {
dawn_standalone = false
}
if (!defined(dawn_has_build)) {
dawn_has_build = true
}
if (!defined(dawn_root)) {
dawn_root = get_path_info("..", "abspath")
}
dawn_gen_root = get_path_info("${dawn_root}", "gen_dir")
if (!defined(dawn_jinja2_dir)) {
dawn_jinja2_dir = "//third_party/jinja2"
}
if (!defined(dawn_glfw_dir)) {
dawn_glfw_dir = "//third_party/glfw"
}
if (!defined(dawn_googletest_dir)) {
dawn_googletest_dir = "//third_party/googletest"
}
if (!defined(dawn_spirv_tools_dir)) {
dawn_spirv_tools_dir = "//third_party/vulkan-deps/spirv-tools/src"
}
if (!defined(dawn_swiftshader_dir)) {
# Default to swiftshader not being available.
dawn_swiftshader_dir = ""
}
if (!defined(dawn_vulkan_deps_dir)) {
dawn_vulkan_deps_dir = "//third_party/vulkan-deps"
if (dawn_standalone) {
dawn_vulkan_deps_dir = "${dawn_root}/third_party/vulkan-deps"
}
}
if (!defined(dawn_vulkan_headers_dir)) {
dawn_vulkan_headers_dir = "${dawn_vulkan_deps_dir}/vulkan-headers/src"
}
if (!defined(dawn_vulkan_loader_dir)) {
# Default to the Vulkan loader not being available except in standalone.
dawn_vulkan_loader_dir = ""
if (dawn_standalone) {
dawn_vulkan_loader_dir = "//third_party/vulkan-deps/vulkan-loader/src"
}
}
if (!defined(dawn_vulkan_tools_dir)) {
dawn_vulkan_tools_dir = "${dawn_vulkan_deps_dir}/vulkan-tools/src"
}
if (!defined(dawn_vulkan_validation_layers_dir)) {
# Default to VVLs not being available.
dawn_vulkan_validation_layers_dir = ""
}
if (!defined(dawn_abseil_dir)) {
dawn_abseil_dir = "//third_party/abseil-cpp"
}
if (!defined(dawn_version_file)) {
dawn_version_file = ""
}