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_link_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_link_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/link/linker.cpp", 79 ] 80 81 include_dirs = deqp_common_include_dirs 82 include_dirs += [ 83 "//third_party/spirv-tools", 84 "//third_party/vk-gl-cts/build/external/spirv-tools/spirv-tools", 85 "//third_party/spirv-headers/include", 86 "//third_party/spirv-headers/include/spirv/unified1", 87 "//third_party/spirv-tools/include", 88 ] 89 90 if (build_with_chromium) { 91 configs -= [ "//build/config/compiler:chromium_code" ] 92 configs += [ "//build/config/compiler:no_chromium_code" ] 93 } 94 95 configs = [ ":deqp_spirvtool_link_config" ] 96 configs += [ ":spv_headers_public_config" ] 97 configs += [ ":spvtools_internal_config" ] 98} 99 100ohos_static_library("libdeqp_spirvtools-link") { 101 deps = [ 102 ":deqp_spirvtool_link_source", 103 "//third_party/spirv-tools:libdeqp_spirvtools", 104 "//third_party/spirv-tools/source/opt:libdeqp_spirvtools-opt", 105 "//third_party/spirv-tools/source/val:libdeqp_spirvtools-val", 106 ] 107 part_name = "graphic_2d" 108 subsystem_name = "graphic" 109} 110