• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//third_party/vk-gl-cts/vk_gl_cts.gni")
16
17config("deqp_spirvtool_reduce_config") {
18  cflags_cc = deqp_common_cflags_cc
19  cflags_cc += [ "-ftemplate-depth=1024" ]
20  defines = deqp_common_defines
21  defines += [
22    "SPIRV_CHECK_CONTEXT",
23    "SPIRV_COLOR_TERMINAL",
24    "SPIRV_LINUX",
25    "SPIRV_TIMER_ENABLED",
26  ]
27}
28
29config("spv_headers_public_config") {
30  include_dirs = [ "include" ]
31}
32
33config("spvtools_include_gen_dirs") {
34  include_dirs = [ "$target_gen_dir" ]
35}
36
37config("spvtools_internal_config") {
38  include_dirs = [
39    ".",
40    "//third_party/spirv-headers/include",
41  ]
42
43  configs = [
44    ":spv_headers_public_config",
45    ":spvtools_include_gen_dirs",
46  ]
47
48  cflags = []
49  if (is_clang) {
50    cflags += [
51      "-Wno-implicit-fallthrough",
52      "-Wno-newline-eof",
53      "-Wno-unreachable-code-break",
54      "-Wno-unreachable-code-return",
55    ]
56  } else if (!is_win) {
57    # Work around a false-positive on a Skia GCC 10 builder.
58    cflags += [ "-Wno-format-truncation" ]
59  } else {
60    # Make MSVC report the correct value for __cplusplus
61    cflags += [ "/Zc:__cplusplus" ]
62  }
63
64  if (!is_win) {
65    cflags += [ "-std=c++17" ]
66  } else {
67    cflags += [ "/std:c++17" ]
68  }
69}
70
71ohos_source_set("deqp_spirvtool_reduce_source") {
72  sources = [
73    "//third_party/spirv-tools/include/spirv-tools/instrument.hpp",
74    "//third_party/spirv-tools/include/spirv-tools/libspirv.h",
75    "//third_party/spirv-tools/include/spirv-tools/libspirv.hpp",
76    "//third_party/spirv-tools/include/spirv-tools/linker.hpp",
77    "//third_party/spirv-tools/include/spirv-tools/optimizer.hpp",
78    "//third_party/spirv-tools/source/reduce/change_operand_reduction_opportunity.cpp",
79    "//third_party/spirv-tools/source/reduce/change_operand_reduction_opportunity.h",
80    "//third_party/spirv-tools/source/reduce/change_operand_to_undef_reduction_opportunity.cpp",
81    "//third_party/spirv-tools/source/reduce/change_operand_to_undef_reduction_opportunity.h",
82    "//third_party/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp",
83    "//third_party/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.h",
84    "//third_party/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp",
85    "//third_party/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.h",
86    "//third_party/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.cpp",
87    "//third_party/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.h",
88    "//third_party/spirv-tools/source/reduce/merge_blocks_reduction_opportunity_finder.cpp",
89    "//third_party/spirv-tools/source/reduce/merge_blocks_reduction_opportunity_finder.h",
90    "//third_party/spirv-tools/source/reduce/operand_to_const_reduction_opportunity_finder.cpp",
91    "//third_party/spirv-tools/source/reduce/operand_to_const_reduction_opportunity_finder.h",
92    "//third_party/spirv-tools/source/reduce/operand_to_dominating_id_reduction_opportunity_finder.cpp",
93    "//third_party/spirv-tools/source/reduce/operand_to_dominating_id_reduction_opportunity_finder.h",
94    "//third_party/spirv-tools/source/reduce/operand_to_undef_reduction_opportunity_finder.cpp",
95    "//third_party/spirv-tools/source/reduce/operand_to_undef_reduction_opportunity_finder.h",
96    "//third_party/spirv-tools/source/reduce/reducer.cpp",
97    "//third_party/spirv-tools/source/reduce/reducer.h",
98    "//third_party/spirv-tools/source/reduce/reduction_opportunity.cpp",
99    "//third_party/spirv-tools/source/reduce/reduction_opportunity.h",
100    "//third_party/spirv-tools/source/reduce/reduction_opportunity_finder.cpp",
101    "//third_party/spirv-tools/source/reduce/reduction_opportunity_finder.h",
102    "//third_party/spirv-tools/source/reduce/reduction_pass.cpp",
103    "//third_party/spirv-tools/source/reduce/reduction_pass.h",
104    "//third_party/spirv-tools/source/reduce/reduction_util.cpp",
105    "//third_party/spirv-tools/source/reduce/reduction_util.h",
106    "//third_party/spirv-tools/source/reduce/remove_block_reduction_opportunity.cpp",
107    "//third_party/spirv-tools/source/reduce/remove_block_reduction_opportunity.h",
108    "//third_party/spirv-tools/source/reduce/remove_block_reduction_opportunity_finder.cpp",
109    "//third_party/spirv-tools/source/reduce/remove_block_reduction_opportunity_finder.h",
110    "//third_party/spirv-tools/source/reduce/remove_function_reduction_opportunity.cpp",
111    "//third_party/spirv-tools/source/reduce/remove_function_reduction_opportunity.h",
112    "//third_party/spirv-tools/source/reduce/remove_function_reduction_opportunity_finder.cpp",
113    "//third_party/spirv-tools/source/reduce/remove_function_reduction_opportunity_finder.h",
114    "//third_party/spirv-tools/source/reduce/remove_instruction_reduction_opportunity.cpp",
115    "//third_party/spirv-tools/source/reduce/remove_instruction_reduction_opportunity.h",
116    "//third_party/spirv-tools/source/reduce/remove_selection_reduction_opportunity.cpp",
117    "//third_party/spirv-tools/source/reduce/remove_selection_reduction_opportunity.h",
118    "//third_party/spirv-tools/source/reduce/remove_selection_reduction_opportunity_finder.cpp",
119    "//third_party/spirv-tools/source/reduce/remove_selection_reduction_opportunity_finder.h",
120    "//third_party/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp",
121    "//third_party/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.h",
122    "//third_party/spirv-tools/source/reduce/remove_unused_instruction_reduction_opportunity_finder.cpp",
123    "//third_party/spirv-tools/source/reduce/remove_unused_instruction_reduction_opportunity_finder.h",
124    "//third_party/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp",
125    "//third_party/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.h",
126    "//third_party/spirv-tools/source/reduce/simple_conditional_branch_to_branch_opportunity_finder.cpp",
127    "//third_party/spirv-tools/source/reduce/simple_conditional_branch_to_branch_opportunity_finder.h",
128    "//third_party/spirv-tools/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp",
129    "//third_party/spirv-tools/source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.h",
130    "//third_party/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity.cpp",
131    "//third_party/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity.h",
132    "//third_party/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp",
133    "//third_party/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.h",
134    "//third_party/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp",
135    "//third_party/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.h",
136    "//third_party/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp",
137    "//third_party/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity_finder.h",
138  ]
139
140  include_dirs = deqp_common_include_dirs
141  include_dirs += [
142    "//third_party/spirv-tools",
143    "//third_party/vk-gl-cts/build/external/spirv-tools/spirv-tools",
144    "//third_party/spirv-headers/include",
145    "//third_party/spirv-tools/include",
146  ]
147
148  if (build_with_chromium) {
149    configs -= [ "//build/config/compiler:chromium_code" ]
150    configs += [ "//build/config/compiler:no_chromium_code" ]
151  }
152
153  configs = [ ":deqp_spirvtool_reduce_config" ]
154  configs += [ ":spv_headers_public_config" ]
155  configs += [ ":spvtools_internal_config" ]
156}
157
158ohos_static_library("libdeqp_spirvtools-reduce") {
159  deps = [
160    ":deqp_spirvtool_reduce_source",
161    "//third_party/spirv-tools:libdeqp_spirvtools",
162    "//third_party/spirv-tools/source/opt:libdeqp_spirvtools-opt",
163  ]
164  part_name = "graphic_2d"
165  subsystem_name = "graphic"
166}
167