blob: bbe79e18c4a3da4ce6176a50caca929889994ce8 [file] [log] [blame]
Corentin Wallez649e2fe2018-08-03 15:57:43 +02001# Copyright 2018 The Dawn Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# This files imports the overrides for Dawn but sets the defaults so that
16# projects including Dawn don't have to set dirs if they happen to use the
17# same.
18# It takes advantage of GN's variable scoping rules to define global variables
19# inside if constructs.
20
21import("//build_overrides/dawn.gni")
22
Corentin Wallez76664ed82018-09-25 21:52:44 +000023if (!defined(dawn_standalone)) {
24 dawn_standalone = false
25}
26
Corentin Wallez30ec4fc2020-04-07 19:35:47 +000027if (!defined(dawn_has_build)) {
28 dawn_has_build = true
29}
30
Corentin Wallez579cf622019-03-07 01:46:39 +000031if (!defined(dawn_root)) {
32 dawn_root = get_path_info("..", "abspath")
33}
Corentin Walleza9a84df2019-09-19 23:30:42 +000034dawn_gen_root = get_path_info("${dawn_root}", "gen_dir")
Corentin Wallez579cf622019-03-07 01:46:39 +000035
Corentin Wallez16092fa2018-10-04 17:17:57 +000036if (!defined(dawn_jinja2_dir)) {
37 dawn_jinja2_dir = "//third_party/jinja2"
Corentin Wallez649e2fe2018-08-03 15:57:43 +020038}
39
40if (!defined(dawn_glfw_dir)) {
41 dawn_glfw_dir = "//third_party/glfw"
42}
Corentin Wallez3bb0bb92018-08-13 17:47:44 +020043
Corentin Wallez16092fa2018-10-04 17:17:57 +000044if (!defined(dawn_googletest_dir)) {
45 dawn_googletest_dir = "//third_party/googletest"
46}
47
Corentin Wallez16092fa2018-10-04 17:17:57 +000048if (!defined(dawn_spirv_tools_dir)) {
Stephen Whitef1fa60b2021-01-06 17:41:50 +000049 dawn_spirv_tools_dir = "//third_party/vulkan-deps/spirv-tools/src"
Corentin Wallez3bb0bb92018-08-13 17:47:44 +020050}
Li, Hao0e1bef32019-11-07 12:13:27 +000051
Corentin Wallez74cebd62019-11-26 18:21:51 +000052if (!defined(dawn_swiftshader_dir)) {
53 # Default to swiftshader not being available.
54 dawn_swiftshader_dir = ""
55}
56
Loko Kung23d09c62022-04-09 00:10:08 +000057if (!defined(dawn_vulkan_deps_dir)) {
58 dawn_vulkan_deps_dir = "//third_party/vulkan-deps"
Loko Kung09100b72022-04-01 05:22:55 +000059 if (dawn_standalone) {
Loko Kung23d09c62022-04-09 00:10:08 +000060 dawn_vulkan_deps_dir = "${dawn_root}/third_party/vulkan-deps"
Loko Kung09100b72022-04-01 05:22:55 +000061 }
62}
63
Loko Kung23d09c62022-04-09 00:10:08 +000064if (!defined(dawn_vulkan_headers_dir)) {
65 dawn_vulkan_headers_dir = "${dawn_vulkan_deps_dir}/vulkan-headers/src"
66}
67
Corentin Wallez09257202020-04-17 08:22:25 +000068if (!defined(dawn_vulkan_loader_dir)) {
Kai Ninomiyaec5aa6e2021-12-02 01:05:41 +000069 # Default to the Vulkan loader not being available except in standalone.
70 dawn_vulkan_loader_dir = ""
71 if (dawn_standalone) {
72 dawn_vulkan_loader_dir = "//third_party/vulkan-deps/vulkan-loader/src"
73 }
Corentin Wallez09257202020-04-17 08:22:25 +000074}
75
Loko Kung23d09c62022-04-09 00:10:08 +000076if (!defined(dawn_vulkan_tools_dir)) {
77 dawn_vulkan_tools_dir = "${dawn_vulkan_deps_dir}/vulkan-tools/src"
78}
79
Zhenyao Mod9d9d1e2020-04-08 20:00:12 +000080if (!defined(dawn_vulkan_validation_layers_dir)) {
81 # Default to VVLs not being available.
82 dawn_vulkan_validation_layers_dir = ""
Li, Hao0e1bef32019-11-07 12:13:27 +000083}
Ryan Harrison4f3811c2020-05-07 21:15:55 +000084
Brandon Jonesa04663c2021-09-23 20:36:03 +000085if (!defined(dawn_abseil_dir)) {
86 dawn_abseil_dir = "//third_party/abseil-cpp"
87}
Loko Kung7d2b9d92022-06-22 04:19:43 +000088
89if (!defined(dawn_version_file)) {
90 dawn_version_file = ""
91}