Corentin Wallez | 649e2fe | 2018-08-03 15:57:43 +0200 | [diff] [blame] | 1 | # 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 | |
| 21 | import("//build_overrides/dawn.gni") |
| 22 | |
Corentin Wallez | 76664ed8 | 2018-09-25 21:52:44 +0000 | [diff] [blame] | 23 | if (!defined(dawn_standalone)) { |
| 24 | dawn_standalone = false |
| 25 | } |
| 26 | |
Corentin Wallez | 30ec4fc | 2020-04-07 19:35:47 +0000 | [diff] [blame] | 27 | if (!defined(dawn_has_build)) { |
| 28 | dawn_has_build = true |
| 29 | } |
| 30 | |
Corentin Wallez | 579cf62 | 2019-03-07 01:46:39 +0000 | [diff] [blame] | 31 | if (!defined(dawn_root)) { |
| 32 | dawn_root = get_path_info("..", "abspath") |
| 33 | } |
Corentin Wallez | a9a84df | 2019-09-19 23:30:42 +0000 | [diff] [blame] | 34 | dawn_gen_root = get_path_info("${dawn_root}", "gen_dir") |
Corentin Wallez | 579cf62 | 2019-03-07 01:46:39 +0000 | [diff] [blame] | 35 | |
Corentin Wallez | 16092fa | 2018-10-04 17:17:57 +0000 | [diff] [blame] | 36 | if (!defined(dawn_jinja2_dir)) { |
| 37 | dawn_jinja2_dir = "//third_party/jinja2" |
Corentin Wallez | 649e2fe | 2018-08-03 15:57:43 +0200 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | if (!defined(dawn_glfw_dir)) { |
| 41 | dawn_glfw_dir = "//third_party/glfw" |
| 42 | } |
Corentin Wallez | 3bb0bb9 | 2018-08-13 17:47:44 +0200 | [diff] [blame] | 43 | |
Corentin Wallez | 16092fa | 2018-10-04 17:17:57 +0000 | [diff] [blame] | 44 | if (!defined(dawn_googletest_dir)) { |
| 45 | dawn_googletest_dir = "//third_party/googletest" |
| 46 | } |
| 47 | |
Corentin Wallez | 16092fa | 2018-10-04 17:17:57 +0000 | [diff] [blame] | 48 | if (!defined(dawn_spirv_tools_dir)) { |
Stephen White | f1fa60b | 2021-01-06 17:41:50 +0000 | [diff] [blame] | 49 | dawn_spirv_tools_dir = "//third_party/vulkan-deps/spirv-tools/src" |
Corentin Wallez | 3bb0bb9 | 2018-08-13 17:47:44 +0200 | [diff] [blame] | 50 | } |
Li, Hao | 0e1bef3 | 2019-11-07 12:13:27 +0000 | [diff] [blame] | 51 | |
Corentin Wallez | 74cebd6 | 2019-11-26 18:21:51 +0000 | [diff] [blame] | 52 | if (!defined(dawn_swiftshader_dir)) { |
| 53 | # Default to swiftshader not being available. |
| 54 | dawn_swiftshader_dir = "" |
| 55 | } |
| 56 | |
Loko Kung | 23d09c6 | 2022-04-09 00:10:08 +0000 | [diff] [blame] | 57 | if (!defined(dawn_vulkan_deps_dir)) { |
| 58 | dawn_vulkan_deps_dir = "//third_party/vulkan-deps" |
Loko Kung | 09100b7 | 2022-04-01 05:22:55 +0000 | [diff] [blame] | 59 | if (dawn_standalone) { |
Loko Kung | 23d09c6 | 2022-04-09 00:10:08 +0000 | [diff] [blame] | 60 | dawn_vulkan_deps_dir = "${dawn_root}/third_party/vulkan-deps" |
Loko Kung | 09100b7 | 2022-04-01 05:22:55 +0000 | [diff] [blame] | 61 | } |
| 62 | } |
| 63 | |
Loko Kung | 23d09c6 | 2022-04-09 00:10:08 +0000 | [diff] [blame] | 64 | if (!defined(dawn_vulkan_headers_dir)) { |
| 65 | dawn_vulkan_headers_dir = "${dawn_vulkan_deps_dir}/vulkan-headers/src" |
| 66 | } |
| 67 | |
Corentin Wallez | 0925720 | 2020-04-17 08:22:25 +0000 | [diff] [blame] | 68 | if (!defined(dawn_vulkan_loader_dir)) { |
Kai Ninomiya | ec5aa6e | 2021-12-02 01:05:41 +0000 | [diff] [blame] | 69 | # 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 Wallez | 0925720 | 2020-04-17 08:22:25 +0000 | [diff] [blame] | 74 | } |
| 75 | |
Loko Kung | 23d09c6 | 2022-04-09 00:10:08 +0000 | [diff] [blame] | 76 | if (!defined(dawn_vulkan_tools_dir)) { |
| 77 | dawn_vulkan_tools_dir = "${dawn_vulkan_deps_dir}/vulkan-tools/src" |
| 78 | } |
| 79 | |
Zhenyao Mo | d9d9d1e | 2020-04-08 20:00:12 +0000 | [diff] [blame] | 80 | if (!defined(dawn_vulkan_validation_layers_dir)) { |
| 81 | # Default to VVLs not being available. |
| 82 | dawn_vulkan_validation_layers_dir = "" |
Li, Hao | 0e1bef3 | 2019-11-07 12:13:27 +0000 | [diff] [blame] | 83 | } |
Ryan Harrison | 4f3811c | 2020-05-07 21:15:55 +0000 | [diff] [blame] | 84 | |
Brandon Jones | a04663c | 2021-09-23 20:36:03 +0000 | [diff] [blame] | 85 | if (!defined(dawn_abseil_dir)) { |
| 86 | dawn_abseil_dir = "//third_party/abseil-cpp" |
| 87 | } |
Loko Kung | 7d2b9d9 | 2022-06-22 04:19:43 +0000 | [diff] [blame] | 88 | |
| 89 | if (!defined(dawn_version_file)) { |
| 90 | dawn_version_file = "" |
| 91 | } |