Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 1 | # Copyright 2020 The Dawn & Tint Authors |
Ryan Harrison | 2962888 | 2020-04-08 20:40:25 +0000 | [diff] [blame] | 2 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 3 | # Redistribution and use in source and binary forms, with or without |
| 4 | # modification, are permitted provided that the following conditions are met: |
Ryan Harrison | 2962888 | 2020-04-08 20:40:25 +0000 | [diff] [blame] | 5 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 6 | # 1. Redistributions of source code must retain the above copyright notice, this |
| 7 | # list of conditions and the following disclaimer. |
Ryan Harrison | 2962888 | 2020-04-08 20:40:25 +0000 | [diff] [blame] | 8 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 9 | # 2. Redistributions in binary form must reproduce the above copyright notice, |
| 10 | # this list of conditions and the following disclaimer in the documentation |
| 11 | # and/or other materials provided with the distribution. |
| 12 | # |
| 13 | # 3. Neither the name of the copyright holder nor the names of its |
| 14 | # contributors may be used to endorse or promote products derived from |
| 15 | # this software without specific prior written permission. |
| 16 | # |
| 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 21 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 23 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 24 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Ryan Harrison | 2962888 | 2020-04-08 20:40:25 +0000 | [diff] [blame] | 27 | |
| 28 | import("//build_overrides/tint.gni") |
| 29 | |
| 30 | # This file contains Tint-related build flags. |
| 31 | |
Ben Clayton | 49a564c | 2023-10-11 16:04:52 +0000 | [diff] [blame] | 32 | if (!defined(tint_standalone)) { |
| 33 | if (defined(dawn_standalone)) { |
| 34 | tint_standalone = dawn_standalone |
| 35 | } else { |
| 36 | tint_standalone = false |
| 37 | } |
| 38 | } |
| 39 | |
Ben Clayton | 66b7566 | 2023-10-03 21:09:50 +0000 | [diff] [blame] | 40 | if (!defined(tint_has_build)) { |
| 41 | tint_has_build = true |
| 42 | } |
| 43 | |
| 44 | tint_has_fuzzers = tint_has_build |
dan sinclair | 0c27cf2 | 2024-06-11 12:31:38 +0000 | [diff] [blame] | 45 | |
| 46 | declare_args() { |
| 47 | # Is protobuf support present |
| 48 | if (!defined(tint_has_protobuf)) { |
| 49 | tint_has_protobuf = tint_standalone || build_with_chromium |
| 50 | } |
| 51 | } |
Ben Clayton | 66b7566 | 2023-10-03 21:09:50 +0000 | [diff] [blame] | 52 | |
Ryan Harrison | 2962888 | 2020-04-08 20:40:25 +0000 | [diff] [blame] | 53 | declare_args() { |
Ryan Harrison | d34b210 | 2020-04-27 15:31:27 +0000 | [diff] [blame] | 54 | # Path to tint checkout |
| 55 | if (!defined(tint_root_dir)) { |
| 56 | tint_root_dir = "//" |
| 57 | } |
| 58 | |
Ryan Harrison | d1cf8a8 | 2020-04-15 20:35:38 +0000 | [diff] [blame] | 59 | # Path to spirv-tools checkout |
| 60 | if (!defined(tint_spirv_tools_dir)) { |
Yuly Novikov | 143523a | 2024-05-23 15:59:58 +0000 | [diff] [blame] | 61 | tint_spirv_tools_dir = "//third_party/spirv-tools/src" |
Ryan Harrison | d1cf8a8 | 2020-04-15 20:35:38 +0000 | [diff] [blame] | 62 | } |
| 63 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 64 | # Path to glslang checkout |
| 65 | if (!defined(tint_glslang_dir)) { |
Yuly Novikov | 143523a | 2024-05-23 15:59:58 +0000 | [diff] [blame] | 66 | tint_glslang_dir = "//third_party/glslang/src" |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 67 | } |
| 68 | |
Ryan Harrison | 0a196c1 | 2020-04-17 13:18:20 +0000 | [diff] [blame] | 69 | # Path to googletest checkout |
| 70 | if (!defined(tint_googletest_dir)) { |
| 71 | tint_googletest_dir = "//third_party/googletest" |
| 72 | } |
| 73 | |
Ryan Harrison | d1cf8a8 | 2020-04-15 20:35:38 +0000 | [diff] [blame] | 74 | # Path to spirv-headers checkout |
| 75 | if (!defined(tint_spirv_headers_dir)) { |
Yuly Novikov | 143523a | 2024-05-23 15:59:58 +0000 | [diff] [blame] | 76 | tint_spirv_headers_dir = "//third_party/spirv-headers/src" |
Ryan Harrison | d1cf8a8 | 2020-04-15 20:35:38 +0000 | [diff] [blame] | 77 | } |
| 78 | |
Ben Clayton | 818dfde | 2024-05-27 22:48:41 +0000 | [diff] [blame] | 79 | # Path to libprotobuf-mutator checkout |
| 80 | if (!defined(tint_lpm_dir)) { |
| 81 | tint_lpm_dir = "//third_party/libprotobuf-mutator" |
| 82 | } |
| 83 | |
Ben Clayton | 49a564c | 2023-10-11 16:04:52 +0000 | [diff] [blame] | 84 | if (!defined(tint_build_cmds)) { |
| 85 | tint_build_cmds = tint_standalone |
| 86 | } |
| 87 | |
Ryan Harrison | d1cf8a8 | 2020-04-15 20:35:38 +0000 | [diff] [blame] | 88 | # Build the SPIR-V input reader |
| 89 | if (!defined(tint_build_spv_reader)) { |
Ryan Harrison | 40f16dd | 2020-07-30 18:44:04 +0000 | [diff] [blame] | 90 | tint_build_spv_reader = true |
Ryan Harrison | d1cf8a8 | 2020-04-15 20:35:38 +0000 | [diff] [blame] | 91 | } |
| 92 | |
Ryan Harrison | 2b45a52 | 2020-04-15 20:37:02 +0000 | [diff] [blame] | 93 | # Build the SPIR-V output writer |
| 94 | if (!defined(tint_build_spv_writer)) { |
Ryan Harrison | 40f16dd | 2020-07-30 18:44:04 +0000 | [diff] [blame] | 95 | tint_build_spv_writer = true |
Ryan Harrison | 2b45a52 | 2020-04-15 20:37:02 +0000 | [diff] [blame] | 96 | } |
| 97 | |
Ryan Harrison | 0caab67 | 2020-04-15 20:47:55 +0000 | [diff] [blame] | 98 | # Build the WGSL input reader |
| 99 | if (!defined(tint_build_wgsl_reader)) { |
Ryan Harrison | 40f16dd | 2020-07-30 18:44:04 +0000 | [diff] [blame] | 100 | tint_build_wgsl_reader = true |
Ryan Harrison | 0caab67 | 2020-04-15 20:47:55 +0000 | [diff] [blame] | 101 | } |
| 102 | |
Ryan Harrison | 460345d | 2020-04-15 20:54:10 +0000 | [diff] [blame] | 103 | # Build the WGSL output writer |
| 104 | if (!defined(tint_build_wgsl_writer)) { |
Ryan Harrison | 40f16dd | 2020-07-30 18:44:04 +0000 | [diff] [blame] | 105 | tint_build_wgsl_writer = true |
Ryan Harrison | 460345d | 2020-04-15 20:54:10 +0000 | [diff] [blame] | 106 | } |
dan sinclair | 2a59901 | 2020-06-23 17:48:40 +0000 | [diff] [blame] | 107 | |
| 108 | # Build the MSL output writer |
| 109 | if (!defined(tint_build_msl_writer)) { |
Ryan Harrison | 40f16dd | 2020-07-30 18:44:04 +0000 | [diff] [blame] | 110 | tint_build_msl_writer = true |
dan sinclair | 2a59901 | 2020-06-23 17:48:40 +0000 | [diff] [blame] | 111 | } |
Ryan Harrison | 7a0b734 | 2020-07-22 20:41:12 +0000 | [diff] [blame] | 112 | |
| 113 | # Build the HLSL output writer |
| 114 | if (!defined(tint_build_hlsl_writer)) { |
Ryan Harrison | 40f16dd | 2020-07-30 18:44:04 +0000 | [diff] [blame] | 115 | tint_build_hlsl_writer = true |
Ryan Harrison | 7a0b734 | 2020-07-22 20:41:12 +0000 | [diff] [blame] | 116 | } |
Stephen White | a9f8c7d | 2021-10-06 18:55:10 +0000 | [diff] [blame] | 117 | |
| 118 | # Build the GLSL output writer |
| 119 | if (!defined(tint_build_glsl_writer)) { |
| 120 | tint_build_glsl_writer = true |
| 121 | } |
dan sinclair | 77bf233 | 2022-06-22 12:40:43 +0000 | [diff] [blame] | 122 | |
Ben Clayton | f1b8a01 | 2023-10-11 17:15:52 +0000 | [diff] [blame] | 123 | # Build the GLSL output validator |
| 124 | if (!defined(tint_build_glsl_validator)) { |
| 125 | tint_build_glsl_validator = true |
| 126 | } |
| 127 | |
dan sinclair | 0917fbb | 2023-03-07 18:28:38 +0000 | [diff] [blame] | 128 | # Build the Syntax Tree writer |
| 129 | if (!defined(tint_build_syntax_tree_writer)) { |
| 130 | tint_build_syntax_tree_writer = false |
| 131 | } |
| 132 | |
Ben Clayton | 5e1a2a0 | 2024-06-05 21:34:28 +0000 | [diff] [blame] | 133 | # Build IR binary format support |
Ben Clayton | fb07fa9 | 2023-11-17 18:48:59 +0000 | [diff] [blame] | 134 | if (!defined(tint_build_ir_binary)) { |
| 135 | tint_build_ir_binary = tint_has_protobuf |
| 136 | } |
| 137 | |
Ben Clayton | 5e1a2a0 | 2024-06-05 21:34:28 +0000 | [diff] [blame] | 138 | # Build IR binary fuzzer |
| 139 | if (!defined(tint_build_ir_fuzzer)) { |
| 140 | tint_build_ir_fuzzer = false |
| 141 | } |
| 142 | |
Ben Clayton | f9a5b71 | 2024-03-13 17:37:33 +0000 | [diff] [blame] | 143 | # Build the tintd language server |
| 144 | if (!defined(tint_build_tintd)) { |
| 145 | tint_build_tintd = false |
| 146 | } |
| 147 | |
dan sinclair | 77bf233 | 2022-06-22 12:40:43 +0000 | [diff] [blame] | 148 | # Build unittests |
| 149 | if (!defined(tint_build_unittests)) { |
| 150 | tint_build_unittests = true |
| 151 | } |
Ben Clayton | 9d1b610 | 2023-09-29 12:12:48 +0000 | [diff] [blame] | 152 | |
| 153 | # Build benchmarks |
| 154 | if (!defined(tint_build_benchmarks)) { |
| 155 | tint_build_benchmarks = true |
| 156 | } |
Ryan Harrison | d1cf8a8 | 2020-04-15 20:35:38 +0000 | [diff] [blame] | 157 | } |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 158 | |
| 159 | declare_args() { |
| 160 | # Directory holding tint source |
| 161 | if (!defined(tint_src_dir)) { |
| 162 | tint_src_dir = "${tint_root_dir}/src/tint" |
| 163 | } |
| 164 | } |