aboutsummaryrefslogtreecommitdiff
path: root/Android.bp
blob: ca6b9f59efc0e77103375354a7176f4df3698332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

package {
    default_applicable_licenses: ["external_deqp-deps_SPIRV-Tools_license"],
}

// Added automatically by a large-scale-change that took the approach of
// 'apply every license found to every target'. While this makes sure we respect
// every license restriction, it may not be entirely correct.
//
// e.g. GPL in an MIT project might only apply to the contrib/ directory.
//
// Please consider splitting the single license below into multiple licenses,
// taking care not to lose any license_kind information, and overriding the
// default license using the 'licenses: [...]' property on targets as needed.
//
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
// to attach the license to, and including a comment whether the files may be
// used in the current project.
// See: http://go/android-license-faq
license {
    name: "external_deqp-deps_SPIRV-Tools_license",
    visibility: [":__subpackages__"],
    license_kinds: [
        "SPDX-license-identifier-Apache-2.0",
        "SPDX-license-identifier-BSD",
        "SPDX-license-identifier-MIT",
    ],
    license_text: [
        "LICENSE",
    ],
}

genrule {
    name: "deqp_spvtools_generate_grammar_tables",
    out: [
        "core.insts-unified1.inc",
        "debuginfo.insts.inc",
        "enum_string_mapping.inc",
        "extension_enum.inc",
        "glsl.std.450.insts.inc",
        "nonsemantic.clspvreflection.insts.inc",
        "nonsemantic.shader.debuginfo.100.insts.inc",
        "opencl.debuginfo.100.insts.inc",
        "opencl.std.insts.inc",
        "operand.kinds-unified1.inc",
        "spv-amd-gcn-shader.insts.inc",
        "spv-amd-shader-ballot.insts.inc",
        "spv-amd-shader-explicit-vertex-parameter.insts.inc",
        "spv-amd-shader-trinary-minmax.insts.inc",
    ],
    srcs: [
        ":deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.glsl.std.450.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.nonsemantic.clspvreflection.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.opencl.std.100.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.spv-amd-gcn-shader.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.spv-amd-shader-ballot.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.spv-amd-shader-trinary-minmax.grammar.json",
        ":deqp_spirv_headers_unified1_spirv.core.grammar.json",
    ],
    tool_files: ["utils/generate_grammar_tables.py"],
    cmd:
        "$(location) --extinst-glsl-grammar=$(location :deqp_spirv_headers_unified1_extinst.glsl.std.450.grammar.json) --glsl-insts-output=$(location glsl.std.450.insts.inc); "+
        "$(location) --extinst-opencl-grammar=$(location :deqp_spirv_headers_unified1_extinst.opencl.std.100.grammar.json) --opencl-insts-output=$(location opencl.std.insts.inc); "+
        "$(location) --extinst-vendor-grammar=$(location :deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json) --vendor-insts-output=$(location debuginfo.insts.inc) --vendor-operand-kind-prefix=; "+
        "$(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=; "+
        "$(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_; "+
        "$(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_; "+
        "$(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=; "+
        "$(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=; "+
        "$(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=; "+
        "$(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=; "+
        "$(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); "+
        "$(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); "
}

genrule {
    name: "deqp_spvtools_generate_language_headers",
    out: [
        "DebugInfo.h",
        "NonSemanticShaderDebugInfo100.h",
        "OpenCLDebugInfo100.h",
    ],
    srcs: [
        ":deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json",
        ":deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json",
    ],
    tool_files: ["utils/generate_language_headers.py"],
    cmd:
        "$(location) --extinst-grammar=$(location :deqp_spirv_headers_unified1_extinst.debuginfo.grammar.json) --extinst-output-path=$(location DebugInfo.h); "+
        "$(location) --extinst-grammar=$(location :deqp_spirv_headers_unified1_extinst.nonsemantic.shader.debuginfo.100.grammar.json) --extinst-output-path=$(location NonSemanticShaderDebugInfo100.h); "+
        "$(location) --extinst-grammar=$(location :deqp_spirv_headers_unified1_extinst.opencl.debuginfo.100.grammar.json) --extinst-output-path=$(location OpenCLDebugInfo100.h); "
}

genrule {
    name: "deqp_spvtools_generate_registry_tables",
    out: [
        "generators.inc"
    ],
    srcs: [
        ":deqp_spirv_headers_spir-v.xml"
    ],
    tool_files: ["utils/generate_registry_tables.py"],
    cmd: "$(location) --xml=$(location :deqp_spirv_headers_spir-v.xml) --generator-output=$(location generators.inc)",
}

genrule { // FIXME this relies on `git` which is no good on build machines
    name: "deqp_spvtools_update_build_version",
    out: ["build-version.inc"],
    srcs: ["CHANGES"],
    tool_files: ["utils/update_build_version.py"],
    cmd: "$(location) $$(dirname $(location CHANGES)) " +
         "$(location build-version.inc)",
}

cc_library {
    name: "deqp_spirv-tools",
    defaults: ["deqp_and_deps_defaults"],
    srcs: [
        "source/*.cpp",
        "source/util/*.cpp",
        "source/val/*.cpp",
        "source/opt/*.cpp",
    ],
    local_include_dirs: [
        ".",
    ],
    export_include_dirs: [
        "include",
    ],
    include_dirs: [
        "external/deqp-deps/SPIRV-Headers/include"
    ],
    generated_headers: [
        "deqp_spvtools_generate_grammar_tables",
        "deqp_spvtools_generate_language_headers",
        "deqp_spvtools_update_build_version",
        "deqp_spvtools_generate_registry_tables",
    ],
    cppflags: [
        "-Wno-implicit-fallthrough",
        "-Wno-sign-conversion",
        "-Wno-switch",
    ],
}