blob: ca6b9f59efc0e77103375354a7176f4df3698332 [file] [log] [blame]
Paul Thomson89c2cd42020-01-28 10:17:37 +00001
Bob Badourab735f02021-02-25 15:03:43 -08002package {
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
20license {
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 Zhang1c9c0722018-12-19 14:40:36 -080033genrule {
Paul Thomson89c2cd42020-01-28 10:17:37 +000034 name: "deqp_spvtools_generate_grammar_tables",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080035 out: [
36 "core.insts-unified1.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080037 "debuginfo.insts.inc",
Paul Thomson89c2cd42020-01-28 10:17:37 +000038 "enum_string_mapping.inc",
39 "extension_enum.inc",
40 "glsl.std.450.insts.inc",
Paul Thomson2080d562021-02-04 10:07:59 +000041 "nonsemantic.clspvreflection.insts.inc",
Paul Thomson58fa4432022-02-08 15:23:04 +000042 "nonsemantic.shader.debuginfo.100.insts.inc",
Paul Thomson89c2cd42020-01-28 10:17:37 +000043 "opencl.debuginfo.100.insts.inc",
44 "opencl.std.insts.inc",
45 "operand.kinds-unified1.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080046 "spv-amd-gcn-shader.insts.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080047 "spv-amd-shader-ballot.insts.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080048 "spv-amd-shader-explicit-vertex-parameter.insts.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080049 "spv-amd-shader-trinary-minmax.insts.inc",
50 ],
51 srcs: [
Paul Thomson2080d562021-02-04 10:07:59 +000052 ":deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json",
Paul Thomson89c2cd42020-01-28 10:17:37 +000053 ":deqp_spirv_headers_unified1_extinst.glsl.std.450.grammar.json",
Paul Thomson2080d562021-02-04 10:07:59 +000054 ":deqp_spirv_headers_unified1_extinst.nonsemantic.clspvreflection.grammar.json",
Paul Thomson58fa4432022-02-08 15:23:04 +000055 ":deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json",
Paul Thomson2080d562021-02-04 10:07:59 +000056 ":deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json",
Paul Thomson89c2cd42020-01-28 10:17:37 +000057 ":deqp_spirv_headers_unified1_extinst.opencl.std.100.grammar.json",
Paul Thomson2080d562021-02-04 10:07:59 +000058 ":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 Thomson89c2cd42020-01-28 10:17:37 +000062 ":deqp_spirv_headers_unified1_spirv.core.grammar.json",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080063 ],
64 tool_files: ["utils/generate_grammar_tables.py"],
Paul Thomson89c2cd42020-01-28 10:17:37 +000065 cmd:
Paul Thomson2080d562021-02-04 10:07:59 +000066 "$(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 Thomson58fa4432022-02-08 15:23:04 +000067 "$(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 Thomson2080d562021-02-04 10:07:59 +000076 "$(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 Zhang1c9c0722018-12-19 14:40:36 -080078}
79
80genrule {
Paul Thomson89c2cd42020-01-28 10:17:37 +000081 name: "deqp_spvtools_generate_language_headers",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080082 out: [
83 "DebugInfo.h",
Paul Thomson58fa4432022-02-08 15:23:04 +000084 "NonSemanticShaderDebugInfo100.h",
Paul Thomson89c2cd42020-01-28 10:17:37 +000085 "OpenCLDebugInfo100.h",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080086 ],
87 srcs: [
Paul Thomson2080d562021-02-04 10:07:59 +000088 ":deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json",
Paul Thomson58fa4432022-02-08 15:23:04 +000089 ":deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json",
Paul Thomson2080d562021-02-04 10:07:59 +000090 ":deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080091 ],
92 tool_files: ["utils/generate_language_headers.py"],
Paul Thomson58fa4432022-02-08 15:23:04 +000093 cmd:
Paul Thomson2080d562021-02-04 10:07:59 +000094 "$(location) --extinst-grammar=$(location :deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json) --extinst-output-path=$(location DebugInfo.h); "+
Paul Thomson58fa4432022-02-08 15:23:04 +000095 "$(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 Zhang1c9c0722018-12-19 14:40:36 -080097}
98
99genrule {
Paul Thomson89c2cd42020-01-28 10:17:37 +0000100 name: "deqp_spvtools_generate_registry_tables",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800101 out: [
102 "generators.inc"
103 ],
104 srcs: [
Paul Thomson89c2cd42020-01-28 10:17:37 +0000105 ":deqp_spirv_headers_spir-v.xml"
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800106 ],
107 tool_files: ["utils/generate_registry_tables.py"],
Paul Thomson89c2cd42020-01-28 10:17:37 +0000108 cmd: "$(location) --xml=$(location :deqp_spirv_headers_spir-v.xml) --generator-output=$(location generators.inc)",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800109}
110
111genrule { // FIXME this relies on `git` which is no good on build machines
Paul Thomson89c2cd42020-01-28 10:17:37 +0000112 name: "deqp_spvtools_update_build_version",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800113 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
120cc_library {
121 name: "deqp_spirv-tools",
Paul Thomson2080d562021-02-04 10:07:59 +0000122 defaults: ["deqp_and_deps_defaults"],
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800123 srcs: [
124 "source/*.cpp",
125 "source/util/*.cpp",
126 "source/val/*.cpp",
127 "source/opt/*.cpp",
128 ],
129 local_include_dirs: [
Paul Thomson2080d562021-02-04 10:07:59 +0000130 ".",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800131 ],
132 export_include_dirs: [
133 "include",
134 ],
135 include_dirs: [
136 "external/deqp-deps/SPIRV-Headers/include"
137 ],
138 generated_headers: [
Paul Thomson89c2cd42020-01-28 10:17:37 +0000139 "deqp_spvtools_generate_grammar_tables",
140 "deqp_spvtools_generate_language_headers",
141 "deqp_spvtools_update_build_version",
142 "deqp_spvtools_generate_registry_tables",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800143 ],
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800144 cppflags: [
Paul Thomson2080d562021-02-04 10:07:59 +0000145 "-Wno-implicit-fallthrough",
146 "-Wno-sign-conversion",
Paul Thomsonb8840482021-09-24 19:58:35 +0000147 "-Wno-switch",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800148 ],
149}