Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 1 | |
Bob Badour | ab735f0 | 2021-02-25 15:03:43 -0800 | [diff] [blame] | 2 | package { |
| 3 | default_applicable_licenses: ["external_deqp-deps_SPIRV-Tools_license"], |
| 4 | } |
| 5 | |
| 6 | // Added automatically by a large-scale-change that took the approach of |
| 7 | // 'apply every license found to every target'. While this makes sure we respect |
| 8 | // every license restriction, it may not be entirely correct. |
| 9 | // |
| 10 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 11 | // |
| 12 | // Please consider splitting the single license below into multiple licenses, |
| 13 | // taking care not to lose any license_kind information, and overriding the |
| 14 | // default license using the 'licenses: [...]' property on targets as needed. |
| 15 | // |
| 16 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 17 | // to attach the license to, and including a comment whether the files may be |
| 18 | // used in the current project. |
| 19 | // See: http://go/android-license-faq |
| 20 | license { |
| 21 | name: "external_deqp-deps_SPIRV-Tools_license", |
| 22 | visibility: [":__subpackages__"], |
| 23 | license_kinds: [ |
| 24 | "SPDX-license-identifier-Apache-2.0", |
| 25 | "SPDX-license-identifier-BSD", |
| 26 | "SPDX-license-identifier-MIT", |
| 27 | ], |
| 28 | license_text: [ |
| 29 | "LICENSE", |
| 30 | ], |
| 31 | } |
| 32 | |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 33 | genrule { |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 34 | name: "deqp_spvtools_generate_grammar_tables", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 35 | out: [ |
| 36 | "core.insts-unified1.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 37 | "debuginfo.insts.inc", |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 38 | "enum_string_mapping.inc", |
| 39 | "extension_enum.inc", |
| 40 | "glsl.std.450.insts.inc", |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 41 | "nonsemantic.clspvreflection.insts.inc", |
Paul Thomson | 58fa443 | 2022-02-08 15:23:04 +0000 | [diff] [blame] | 42 | "nonsemantic.shader.debuginfo.100.insts.inc", |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 43 | "opencl.debuginfo.100.insts.inc", |
| 44 | "opencl.std.insts.inc", |
| 45 | "operand.kinds-unified1.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 46 | "spv-amd-gcn-shader.insts.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 47 | "spv-amd-shader-ballot.insts.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 48 | "spv-amd-shader-explicit-vertex-parameter.insts.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 49 | "spv-amd-shader-trinary-minmax.insts.inc", |
| 50 | ], |
| 51 | srcs: [ |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 52 | ":deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json", |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 53 | ":deqp_spirv_headers_unified1_extinst.glsl.std.450.grammar.json", |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 54 | ":deqp_spirv_headers_unified1_extinst.nonsemantic.clspvreflection.grammar.json", |
Paul Thomson | 58fa443 | 2022-02-08 15:23:04 +0000 | [diff] [blame] | 55 | ":deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json", |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 56 | ":deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json", |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 57 | ":deqp_spirv_headers_unified1_extinst.opencl.std.100.grammar.json", |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 58 | ":deqp_spirv_headers_unified1_extinst.spv-amd-gcn-shader.grammar.json", |
| 59 | ":deqp_spirv_headers_unified1_extinst.spv-amd-shader-ballot.grammar.json", |
| 60 | ":deqp_spirv_headers_unified1_extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json", |
| 61 | ":deqp_spirv_headers_unified1_extinst.spv-amd-shader-trinary-minmax.grammar.json", |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 62 | ":deqp_spirv_headers_unified1_spirv.core.grammar.json", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 63 | ], |
| 64 | tool_files: ["utils/generate_grammar_tables.py"], |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 65 | cmd: |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 66 | "$(location) --extinst-glsl-grammar=$(location :deqp_spirv_headers_unified1_extinst.glsl.std.450.grammar.json) --glsl-insts-output=$(location glsl.std.450.insts.inc); "+ |
Paul Thomson | 58fa443 | 2022-02-08 15:23:04 +0000 | [diff] [blame] | 67 | "$(location) --extinst-opencl-grammar=$(location :deqp_spirv_headers_unified1_extinst.opencl.std.100.grammar.json) --opencl-insts-output=$(location opencl.std.insts.inc); "+ |
| 68 | "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json) --vendor-insts-output=$(location debuginfo.insts.inc) --vendor-operand-kind-prefix=; "+ |
| 69 | "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.nonsemantic.clspvreflection.grammar.json) --vendor-insts-output=$(location nonsemantic.clspvreflection.insts.inc) --vendor-operand-kind-prefix=; "+ |
| 70 | "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json) --vendor-insts-output=$(location nonsemantic.shader.debuginfo.100.insts.inc) --vendor-operand-kind-prefix=SHDEBUG100_; "+ |
| 71 | "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json) --vendor-insts-output=$(location opencl.debuginfo.100.insts.inc) --vendor-operand-kind-prefix=CLDEBUG100_; "+ |
| 72 | "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.spv-amd-gcn-shader.grammar.json) --vendor-insts-output=$(location spv-amd-gcn-shader.insts.inc) --vendor-operand-kind-prefix=; "+ |
| 73 | "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.spv-amd-shader-ballot.grammar.json) --vendor-insts-output=$(location spv-amd-shader-ballot.insts.inc) --vendor-operand-kind-prefix=; "+ |
| 74 | "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json) --vendor-insts-output=$(location spv-amd-shader-explicit-vertex-parameter.insts.inc) --vendor-operand-kind-prefix=; "+ |
| 75 | "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.spv-amd-shader-trinary-minmax.grammar.json) --vendor-insts-output=$(location spv-amd-shader-trinary-minmax.insts.inc) --vendor-operand-kind-prefix=; "+ |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 76 | "$(location) --spirv-core-grammar=$(location :deqp_spirv_headers_unified1_spirv.core.grammar.json) --extinst-debuginfo-grammar=$(location :deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json) --extinst-cldebuginfo100-grammar=$(location :deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json) --core-insts-output=$(location core.insts-unified1.inc) --operand-kinds-output=$(location operand.kinds-unified1.inc); "+ |
| 77 | "$(location) --spirv-core-grammar=$(location :deqp_spirv_headers_unified1_spirv.core.grammar.json) --extinst-debuginfo-grammar=$(location :deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json) --extinst-cldebuginfo100-grammar=$(location :deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json) --extension-enum-output=$(location extension_enum.inc) --enum-string-mapping-output=$(location enum_string_mapping.inc); " |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | genrule { |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 81 | name: "deqp_spvtools_generate_language_headers", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 82 | out: [ |
| 83 | "DebugInfo.h", |
Paul Thomson | 58fa443 | 2022-02-08 15:23:04 +0000 | [diff] [blame] | 84 | "NonSemanticShaderDebugInfo100.h", |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 85 | "OpenCLDebugInfo100.h", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 86 | ], |
| 87 | srcs: [ |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 88 | ":deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json", |
Paul Thomson | 58fa443 | 2022-02-08 15:23:04 +0000 | [diff] [blame] | 89 | ":deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json", |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 90 | ":deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 91 | ], |
| 92 | tool_files: ["utils/generate_language_headers.py"], |
Paul Thomson | 58fa443 | 2022-02-08 15:23:04 +0000 | [diff] [blame] | 93 | cmd: |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 94 | "$(location) --extinst-grammar=$(location :deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json) --extinst-output-path=$(location DebugInfo.h); "+ |
Paul Thomson | 58fa443 | 2022-02-08 15:23:04 +0000 | [diff] [blame] | 95 | "$(location) --extinst-grammar=$(location :deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json) --extinst-output-path=$(location NonSemanticShaderDebugInfo100.h); "+ |
| 96 | "$(location) --extinst-grammar=$(location :deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json) --extinst-output-path=$(location OpenCLDebugInfo100.h); " |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | genrule { |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 100 | name: "deqp_spvtools_generate_registry_tables", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 101 | out: [ |
| 102 | "generators.inc" |
| 103 | ], |
| 104 | srcs: [ |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 105 | ":deqp_spirv_headers_spir-v.xml" |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 106 | ], |
| 107 | tool_files: ["utils/generate_registry_tables.py"], |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 108 | cmd: "$(location) --xml=$(location :deqp_spirv_headers_spir-v.xml) --generator-output=$(location generators.inc)", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | genrule { // FIXME this relies on `git` which is no good on build machines |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 112 | name: "deqp_spvtools_update_build_version", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 113 | out: ["build-version.inc"], |
| 114 | srcs: ["CHANGES"], |
| 115 | tool_files: ["utils/update_build_version.py"], |
| 116 | cmd: "$(location) $$(dirname $(location CHANGES)) " + |
| 117 | "$(location build-version.inc)", |
| 118 | } |
| 119 | |
| 120 | cc_library { |
| 121 | name: "deqp_spirv-tools", |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 122 | defaults: ["deqp_and_deps_defaults"], |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 123 | srcs: [ |
| 124 | "source/*.cpp", |
| 125 | "source/util/*.cpp", |
| 126 | "source/val/*.cpp", |
| 127 | "source/opt/*.cpp", |
| 128 | ], |
| 129 | local_include_dirs: [ |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 130 | ".", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 131 | ], |
| 132 | export_include_dirs: [ |
| 133 | "include", |
| 134 | ], |
| 135 | include_dirs: [ |
| 136 | "external/deqp-deps/SPIRV-Headers/include" |
| 137 | ], |
| 138 | generated_headers: [ |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 139 | "deqp_spvtools_generate_grammar_tables", |
| 140 | "deqp_spvtools_generate_language_headers", |
| 141 | "deqp_spvtools_update_build_version", |
| 142 | "deqp_spvtools_generate_registry_tables", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 143 | ], |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 144 | cppflags: [ |
Paul Thomson | 2080d56 | 2021-02-04 10:07:59 +0000 | [diff] [blame] | 145 | "-Wno-implicit-fallthrough", |
| 146 | "-Wno-sign-conversion", |
Paul Thomson | b884048 | 2021-09-24 19:58:35 +0000 | [diff] [blame] | 147 | "-Wno-switch", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 148 | ], |
| 149 | } |