xref: /third_party/glslang/SPIRV/BUILD.gn (revision 617a3bab)
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    "-std=c++17",
29    "-Wno-reorder",
30    "-fno-rtti",
31    "-fno-exceptions",
32    "-Wno-sign-compare",
33    "-Wno-unused-parameter",
34  ]
35
36  defines = deqp_common_defines
37  defines -= [
38    "DEQP_SUPPORT_DRM=0",
39    "DEQP_TARGET_NAME=\"Default\"",
40  ]
41  defines += [
42    "ENABLE_HLSL",
43    "ENABLE_OPT=0",
44    "GLSLANG_OSINCLUDE_UNIX",
45  ]
46}
47
48#lib SPIRV
49ohos_source_set("SPIRV_source") {
50  sources = [
51    "//third_party/glslang/SPIRV/CInterface/spirv_c_interface.cpp",
52    "//third_party/glslang/SPIRV/GlslangToSpv.cpp",
53    "//third_party/glslang/SPIRV/InReadableOrder.cpp",
54    "//third_party/glslang/SPIRV/Logger.cpp",
55    "//third_party/glslang/SPIRV/SpvBuilder.cpp",
56    "//third_party/glslang/SPIRV/SpvPostProcess.cpp",
57    "//third_party/glslang/SPIRV/SpvTools.cpp",
58    "//third_party/glslang/SPIRV/disassemble.cpp",
59    "//third_party/glslang/SPIRV/doc.cpp",
60  ]
61  include_dirs = [
62    "//third_party/zlib/src",
63    "//third_party/glslang",
64    "//third_party/glslang/glslang/SPIRV",
65    "//third_party/vk-gl-cts/build/include",
66  ]
67  include_dirs += deqp_common_include_dirs
68
69  deps = [
70    #"//third_party/glslang/OGLCompilersDLL:libdeqp_OGLCompiler",
71    "//third_party/glslang/glslang:libdeqp_GenericCodeGen",
72    "//third_party/glslang/glslang:libdeqp_MachineIndependent",
73    "//third_party/glslang/glslang:libdeqp_OSDependent",
74  ]
75  configs = [ ":SPIRV_config" ]
76}
77
78ohos_shared_library("libdeqp_spirv") {
79  deps = [ ":SPIRV_source" ]
80  part_name = "graphic_2d"
81  subsystem_name = "graphic"
82}
83
84#lib SPVRemapper
85ohos_source_set("SPVRemapper_source") {
86  sources = [
87    "//third_party/glslang/SPIRV/SPVRemapper.cpp",
88    "//third_party/glslang/SPIRV/doc.cpp",
89  ]
90  include_dirs = [
91    "//third_party/zlib/src",
92    "//third_party/glslang",
93    "//third_party/glslang/glslang/SPIRV",
94    "//third_party/vk-gl-cts/build/include",
95  ]
96  include_dirs += deqp_common_include_dirs
97
98  deps = []
99  configs = [ ":SPIRV_config" ]
100}
101
102ohos_shared_library("libdeqp_spvremapper") {
103  deps = [ ":SPVRemapper_source" ]
104  part_name = "graphic_2d"
105  subsystem_name = "graphic"
106}
107