blob: e99ea8f23db2f5f3c18996c7ac57485b396f053d [file] [log] [blame]
Paul Thomson89c2cd42020-01-28 10:17:37 +00001
2// genrules were obtained from the CMake build:
3// $ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug
4// $ ninja -v -j 1 >log.log
5// Find Python invocations.
6// Use regex replacements to get "cmd:" lines below.
Yiwei Zhang1c9c0722018-12-19 14:40:36 -08007
8genrule {
Paul Thomson89c2cd42020-01-28 10:17:37 +00009 name: "deqp_spvtools_generate_grammar_tables",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080010 out: [
11 "core.insts-unified1.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080012 "debuginfo.insts.inc",
Paul Thomson89c2cd42020-01-28 10:17:37 +000013 "enum_string_mapping.inc",
14 "extension_enum.inc",
15 "glsl.std.450.insts.inc",
16 "opencl.debuginfo.100.insts.inc",
17 "opencl.std.insts.inc",
18 "operand.kinds-unified1.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080019 "spv-amd-gcn-shader.insts.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080020 "spv-amd-shader-ballot.insts.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080021 "spv-amd-shader-explicit-vertex-parameter.insts.inc",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080022 "spv-amd-shader-trinary-minmax.insts.inc",
23 ],
24 srcs: [
Paul Thomson89c2cd42020-01-28 10:17:37 +000025 ":deqp_spirv_headers_unified1_extinst.glsl.std.450.grammar.json",
26 ":deqp_spirv_headers_unified1_extinst.opencl.std.100.grammar.json",
27 ":deqp_spirv_headers_unified1_spirv.core.grammar.json",
28 "source/extinst.debuginfo.grammar.json",
29 "source/extinst.opencl.debuginfo.100.grammar.json",
30 "source/extinst.spv-amd-gcn-shader.grammar.json",
31 "source/extinst.spv-amd-shader-ballot.grammar.json",
32 "source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080033 "source/extinst.spv-amd-shader-trinary-minmax.grammar.json",
34 ],
35 tool_files: ["utils/generate_grammar_tables.py"],
Paul Thomson89c2cd42020-01-28 10:17:37 +000036 cmd:
37 "$(location) --extinst-vendor-grammar=$(location source/extinst.spv-amd-gcn-shader.grammar.json) --vendor-insts-output=$(location spv-amd-gcn-shader.insts.inc) --vendor-operand-kind-prefix=; "+
38 "$(location) --spirv-core-grammar=$(location :deqp_spirv_headers_unified1_spirv.core.grammar.json) --extinst-debuginfo-grammar=$(location source/extinst.debuginfo.grammar.json) --extinst-cldebuginfo100-grammar=$(location source/extinst.opencl.debuginfo.100.grammar.json) --core-insts-output=$(location core.insts-unified1.inc) --operand-kinds-output=$(location operand.kinds-unified1.inc); "+
39 "$(location) --extinst-vendor-grammar=$(location source/extinst.debuginfo.grammar.json) --vendor-insts-output=$(location debuginfo.insts.inc) --vendor-operand-kind-prefix=; "+
40 "$(location) --extinst-vendor-grammar=$(location source/extinst.spv-amd-shader-ballot.grammar.json) --vendor-insts-output=$(location spv-amd-shader-ballot.insts.inc) --vendor-operand-kind-prefix=; "+
41 "$(location) --extinst-vendor-grammar=$(location source/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=; "+
42 "$(location) --extinst-vendor-grammar=$(location source/extinst.spv-amd-shader-trinary-minmax.grammar.json) --vendor-insts-output=$(location spv-amd-shader-trinary-minmax.insts.inc) --vendor-operand-kind-prefix=; "+
43 "$(location) --extinst-vendor-grammar=$(location source/extinst.opencl.debuginfo.100.grammar.json) --vendor-insts-output=$(location opencl.debuginfo.100.insts.inc) --vendor-operand-kind-prefix=CLDEBUG100_; "+
44 "$(location) --spirv-core-grammar=$(location :deqp_spirv_headers_unified1_spirv.core.grammar.json) --extinst-debuginfo-grammar=$(location source/extinst.debuginfo.grammar.json) --extinst-cldebuginfo100-grammar=$(location source/extinst.opencl.debuginfo.100.grammar.json) --extension-enum-output=$(location extension_enum.inc) --enum-string-mapping-output=$(location enum_string_mapping.inc); "+
45 "$(location) --extinst-opencl-grammar=$(location :deqp_spirv_headers_unified1_extinst.opencl.std.100.grammar.json) --opencl-insts-output=$(location opencl.std.insts.inc); "+
46 "$(location) --extinst-glsl-grammar=$(location :deqp_spirv_headers_unified1_extinst.glsl.std.450.grammar.json) --glsl-insts-output=$(location glsl.std.450.insts.inc); "
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080047}
48
Paul Thomson89c2cd42020-01-28 10:17:37 +000049
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080050genrule {
Paul Thomson89c2cd42020-01-28 10:17:37 +000051 name: "deqp_spvtools_generate_language_headers",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080052 out: [
53 "DebugInfo.h",
Paul Thomson89c2cd42020-01-28 10:17:37 +000054 "OpenCLDebugInfo100.h",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080055 ],
56 srcs: [
Paul Thomson89c2cd42020-01-28 10:17:37 +000057 "source/extinst.debuginfo.grammar.json",
58 "source/extinst.opencl.debuginfo.100.grammar.json",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080059 ],
60 tool_files: ["utils/generate_language_headers.py"],
Paul Thomson89c2cd42020-01-28 10:17:37 +000061 cmd:
Chris Forbes9653fde2020-04-23 16:19:26 -070062 "$(location) --extinst-grammar=$(location source/extinst.debuginfo.grammar.json) --extinst-output-path=$(location DebugInfo.h); "+
63 "$(location) --extinst-grammar=$(location source/extinst.opencl.debuginfo.100.grammar.json) --extinst-output-path=$(location OpenCLDebugInfo100.h); "
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080064}
65
66genrule {
Paul Thomson89c2cd42020-01-28 10:17:37 +000067 name: "deqp_spvtools_generate_registry_tables",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080068 out: [
69 "generators.inc"
70 ],
71 srcs: [
Paul Thomson89c2cd42020-01-28 10:17:37 +000072 ":deqp_spirv_headers_spir-v.xml"
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080073 ],
74 tool_files: ["utils/generate_registry_tables.py"],
Paul Thomson89c2cd42020-01-28 10:17:37 +000075 cmd: "$(location) --xml=$(location :deqp_spirv_headers_spir-v.xml) --generator-output=$(location generators.inc)",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080076}
77
78genrule { // FIXME this relies on `git` which is no good on build machines
Paul Thomson89c2cd42020-01-28 10:17:37 +000079 name: "deqp_spvtools_update_build_version",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -080080 out: ["build-version.inc"],
81 srcs: ["CHANGES"],
82 tool_files: ["utils/update_build_version.py"],
83 cmd: "$(location) $$(dirname $(location CHANGES)) " +
84 "$(location build-version.inc)",
85}
86
87cc_library {
88 name: "deqp_spirv-tools",
89 sdk_version: "27",
90 srcs: [
91 "source/*.cpp",
92 "source/util/*.cpp",
93 "source/val/*.cpp",
94 "source/opt/*.cpp",
95 ],
96 local_include_dirs: [
97 "source",
98 ],
99 export_include_dirs: [
100 "include",
101 ],
102 include_dirs: [
103 "external/deqp-deps/SPIRV-Headers/include"
104 ],
105 generated_headers: [
Paul Thomson89c2cd42020-01-28 10:17:37 +0000106 "deqp_spvtools_generate_grammar_tables",
107 "deqp_spvtools_generate_language_headers",
108 "deqp_spvtools_update_build_version",
109 "deqp_spvtools_generate_registry_tables",
Yiwei Zhang1c9c0722018-12-19 14:40:36 -0800110 ],
111 stl: "libc++_static",
112 cppflags: [
113 "-Wno-implicit-fallthrough"
114 ],
115}