webgpu/dawn/include/dawn/BUILD.gn
1# Copyright 2019 The Dawn Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import("../../scripts/dawn_overrides_with_defaults.gni")
16
17import("${dawn_root}/generator/dawn_generator.gni")
18import("${dawn_root}/scripts/dawn_component.gni")
19
20###############################################################################
21# Dawn headers
22###############################################################################
23
24dawn_json_generator("headers_gen") {
25 target = "headers"
26 outputs = [
27 "include/dawn/dawn_proc_table.h",
28 "include/dawn/webgpu.h",
29 ]
30}
31
32source_set("headers") {
33 all_dependent_configs = [ ":public" ]
34 public_deps = [ ":headers_gen" ]
35
36 sources = get_target_outputs(":headers_gen")
37}
38
39###############################################################################
40# Dawn C++ headers
41###############################################################################
42
43dawn_json_generator("cpp_headers_gen") {
44 target = "cpp_headers"
45 outputs = [
46 "include/dawn/webgpu_cpp.h",
47 "include/dawn/webgpu_cpp_chained_struct.h",
48 "include/dawn/webgpu_cpp_print.h",
49 ]
50}
51
52source_set("cpp_headers") {
53 public_deps = [
54 ":cpp_headers_gen",
55 ":headers",
56 ]
57
58 sources = get_target_outputs(":cpp_headers_gen")
59 sources += [ "${dawn_root}/include/dawn/EnumClassBitmasks.h" ]
60}
61
62###############################################################################
63# Dawn public include directories
64###############################################################################
65
66config("public") {
67 include_dirs = [
68 "${target_gen_dir}/../../include",
69 "${dawn_root}/include",
70 ]
71}