• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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
14# external glslang src SPIRV build
15
16import("//build/ohos.gni")
17import("//third_party/vk-gl-cts/vk_gl_cts.gni")
18
19config("SPIRV_config") {
20  cflags_cc = deqp_common_cflags_cc
21
22  cflags_cc -= [
23    "-frtti",
24    "-fexceptions",
25  ]
26  cflags_cc += [
27    "-fPIC",
28    "-Wno-reorder",
29    "-fno-rtti",
30    "-fno-exceptions",
31    "-Wno-sign-compare",
32  ]
33
34  defines = deqp_common_defines
35  defines -= [
36    "DEQP_SUPPORT_DRM=0",
37    "DEQP_TARGET_NAME=\"Default\"",
38  ]
39  defines += [
40    "ENABLE_HLSL",
41    "ENABLE_OPT=0",
42    "GLSLANG_OSINCLUDE_UNIX",
43  ]
44}
45
46#lib SPIRV
47ohos_source_set("SPIRV_source") {
48  sources = [
49    "//third_party/glslang/SPIRV/CInterface/spirv_c_interface.cpp",
50    "//third_party/glslang/SPIRV/GlslangToSpv.cpp",
51    "//third_party/glslang/SPIRV/InReadableOrder.cpp",
52    "//third_party/glslang/SPIRV/Logger.cpp",
53    "//third_party/glslang/SPIRV/SpvBuilder.cpp",
54    "//third_party/glslang/SPIRV/SpvPostProcess.cpp",
55    "//third_party/glslang/SPIRV/SpvTools.cpp",
56    "//third_party/glslang/SPIRV/disassemble.cpp",
57    "//third_party/glslang/SPIRV/doc.cpp",
58  ]
59  include_dirs = [
60    "//third_party/zlib/src",
61    "//third_party/glslang",
62    "//third_party/glslang/glslang/SPIRV",
63    "//third_party/vk-gl-cts/build/include",
64  ]
65  include_dirs += deqp_common_include_dirs
66
67  deps = [
68    "//third_party/glslang/OGLCompilersDLL:libdeqp_OGLCompiler",
69    "//third_party/glslang/glslang:libdeqp_GenericCodeGen",
70    "//third_party/glslang/glslang:libdeqp_MachineIndependent",
71    "//third_party/glslang/glslang:libdeqp_OSDependent",
72  ]
73  configs = [ ":SPIRV_config" ]
74}
75
76ohos_shared_library("libdeqp_spirv") {
77  deps = [ ":SPIRV_source" ]
78  part_name = "graphic_2d"
79  subsystem_name = "graphic"
80}
81
82#lib SPVRemapper
83ohos_source_set("SPVRemapper_source") {
84  sources = [
85    "//third_party/glslang/SPIRV/SPVRemapper.cpp",
86    "//third_party/glslang/SPIRV/doc.cpp",
87  ]
88  include_dirs = [
89    "//third_party/zlib/src",
90    "//third_party/glslang",
91    "//third_party/glslang/glslang/SPIRV",
92    "//third_party/vk-gl-cts/build/include",
93  ]
94  include_dirs += deqp_common_include_dirs
95
96  deps = []
97  configs = [ ":SPIRV_config" ]
98}
99
100ohos_shared_library("libdeqp_spvremapper") {
101  deps = [ ":SPVRemapper_source" ]
102  part_name = "graphic_2d"
103  subsystem_name = "graphic"
104}
105