vulkaninfo: Correct typo targetted -> targeted
[KhronosGroup/Vulkan-Tools.git] / BUILD.gn
blob08bd22a1d5fb0d62dba99d138a962aff88ab1960
1 # Copyright (C) 2018-2019 The ANGLE Project Authors.
2 # Copyright (C) 2019-2023 LunarG, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 #     https://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 import("//build_overrides/build.gni")
17 import("//build_overrides/vulkan_tools.gni")
19 if (!is_android) {
20   vulkan_undefine_configs = []
21   if (is_win && build_with_chromium) {
22     vulkan_undefine_configs += [
23       "//build/config/win:nominmax",
24       "//build/config/win:unicode",
25     ]
26   }
28   # Vulkan Mock ICD
29   # ---------------
30   shared_library("VkICD_mock_icd") {
31     configs -= vulkan_undefine_configs
32     deps = [
33       "$vulkan_headers_dir:vulkan_headers"
34     ]
35     data_deps = [ ":vulkan_gen_icd_json_file" ]
36     sources = [
37       "icd/mock_icd.h",
38       "icd/mock_icd.cpp",
39       "icd/generated/function_declarations.h",
40       "icd/generated/function_definitions.h",
41       "icd/generated/vk_typemap_helper.h",
42     ]
43     include_dirs = [
44         "icd",
45         "icd/generated",
46     ]
47     if (is_win) {
48       sources += [ "icd/VkICD_mock_icd.def" ]
49     }
50     if (build_with_chromium) {
51       configs -= [ "//build/config/compiler:chromium_code" ]
52       configs += [ "//build/config/compiler:no_chromium_code" ]
53     }
54   }
56   action("vulkan_gen_icd_json_file") {
57     script = "scripts/gn/generate_vulkan_icd_json.py"
59     public_deps = [ "$vulkan_headers_dir:vulkan_headers" ]
61     sources = [  "icd/VkICD_mock_icd.json.in" ]
63     vulkan_data_dir = "$root_out_dir/$vulkan_data_subdir"
65     outputs = [ "$vulkan_data_dir/VkICD_mock_icd.json" ]
67     if (is_linux) {
68       _platform = "Linux"
69     } else if (is_win) {
70       _platform = "Windows"
71     } else if (is_mac) {
72       _platform = "Darwin"
73     } else if (is_fuchsia) {
74       _platform = "Fuchsia"
75     } else {
76       _platform = "Other"
77     }
79     args =  [
80       "--icd",
81       "--platform", _platform,
82       rebase_path("icd/", root_build_dir),
83       rebase_path(vulkan_data_dir, root_build_dir)
84     ] + rebase_path(sources, root_build_dir)
86     if (is_win) {
87       args += [ "--no-path-prefix" ]
88     }
90     data = outputs
91   }