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") 17 18config("SPIRV_config") { 19 cflags_cc = [ 20 "-fPIC", 21 "-std=c++17", 22 "-Wno-reorder", 23 "-fno-rtti", 24 "-fno-exceptions", 25 "-Wno-sign-compare", 26 "-Wno-unused-parameter", 27 ] 28 29 if (is_mingw) { 30 cflags_cc -= [ "-fPIC" ] 31 } 32 33 defines = [ 34 "ENABLE_HLSL", 35 "ENABLE_OPT=0", 36 "GLSLANG_OSINCLUDE_UNIX", 37 ] 38} 39 40#lib SPIRV 41ohos_source_set("SPIRV_source") { 42 sources = [ 43 "//third_party/glslang/SPIRV/CInterface/spirv_c_interface.cpp", 44 "//third_party/glslang/SPIRV/GlslangToSpv.cpp", 45 "//third_party/glslang/SPIRV/InReadableOrder.cpp", 46 "//third_party/glslang/SPIRV/Logger.cpp", 47 "//third_party/glslang/SPIRV/SpvBuilder.cpp", 48 "//third_party/glslang/SPIRV/SpvPostProcess.cpp", 49 "//third_party/glslang/SPIRV/SpvTools.cpp", 50 "//third_party/glslang/SPIRV/disassemble.cpp", 51 "//third_party/glslang/SPIRV/doc.cpp", 52 ] 53 include_dirs = [ 54 "//third_party/glslang", 55 "//third_party/glslang/glslang/SPIRV", 56 ] 57 58 deps = [ 59 "//third_party/glslang/glslang:libdeqp_GenericCodeGen", 60 "//third_party/glslang/glslang:libdeqp_MachineIndependent", 61 "//third_party/glslang/glslang:libdeqp_OSDependent", 62 ] 63 configs = [ ":SPIRV_config" ] 64} 65 66ohos_shared_library("libdeqp_spirv") { 67 deps = [ ":SPIRV_source" ] 68 part_name = "graphic_2d" 69 subsystem_name = "graphic" 70} 71 72#lib SPVRemapper 73ohos_source_set("SPVRemapper_source") { 74 sources = [ 75 "//third_party/glslang/SPIRV/SPVRemapper.cpp", 76 "//third_party/glslang/SPIRV/doc.cpp", 77 ] 78 include_dirs = [ 79 "//third_party/glslang", 80 "//third_party/glslang/glslang/SPIRV", 81 ] 82 83 deps = [] 84 configs = [ ":SPIRV_config" ] 85} 86 87ohos_shared_library("libdeqp_spvremapper") { 88 deps = [ ":SPVRemapper_source" ] 89 part_name = "graphic_2d" 90 subsystem_name = "graphic" 91} 92