Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 1 | |
| 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 Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 7 | |
| 8 | genrule { |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 9 | name: "deqp_spvtools_generate_grammar_tables", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 10 | out: [ |
| 11 | "core.insts-unified1.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 12 | "debuginfo.insts.inc", |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 13 | "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 Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 19 | "spv-amd-gcn-shader.insts.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 20 | "spv-amd-shader-ballot.insts.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 21 | "spv-amd-shader-explicit-vertex-parameter.insts.inc", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 22 | "spv-amd-shader-trinary-minmax.insts.inc", |
| 23 | ], |
| 24 | srcs: [ |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 25 | ":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 Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 33 | "source/extinst.spv-amd-shader-trinary-minmax.grammar.json", |
| 34 | ], |
| 35 | tool_files: ["utils/generate_grammar_tables.py"], |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 36 | 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 Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 47 | } |
| 48 | |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 49 | |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 50 | genrule { |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 51 | name: "deqp_spvtools_generate_language_headers", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 52 | out: [ |
| 53 | "DebugInfo.h", |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 54 | "OpenCLDebugInfo100.h", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 55 | ], |
| 56 | srcs: [ |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 57 | "source/extinst.debuginfo.grammar.json", |
| 58 | "source/extinst.opencl.debuginfo.100.grammar.json", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 59 | ], |
| 60 | tool_files: ["utils/generate_language_headers.py"], |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 61 | cmd: |
Chris Forbes | 9653fde | 2020-04-23 16:19:26 -0700 | [diff] [blame] | 62 | "$(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 Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | genrule { |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 67 | name: "deqp_spvtools_generate_registry_tables", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 68 | out: [ |
| 69 | "generators.inc" |
| 70 | ], |
| 71 | srcs: [ |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 72 | ":deqp_spirv_headers_spir-v.xml" |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 73 | ], |
| 74 | tool_files: ["utils/generate_registry_tables.py"], |
Paul Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 75 | 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] | 76 | } |
| 77 | |
| 78 | 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] | 79 | name: "deqp_spvtools_update_build_version", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 80 | 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 | |
| 87 | cc_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 Thomson | 89c2cd4 | 2020-01-28 10:17:37 +0000 | [diff] [blame] | 106 | "deqp_spvtools_generate_grammar_tables", |
| 107 | "deqp_spvtools_generate_language_headers", |
| 108 | "deqp_spvtools_update_build_version", |
| 109 | "deqp_spvtools_generate_registry_tables", |
Yiwei Zhang | 1c9c072 | 2018-12-19 14:40:36 -0800 | [diff] [blame] | 110 | ], |
| 111 | stl: "libc++_static", |
| 112 | cppflags: [ |
| 113 | "-Wno-implicit-fallthrough" |
| 114 | ], |
| 115 | } |