-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathBUILD.bazel
171 lines (146 loc) · 3.44 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
PRODUCT_NAME = "shared"
PKG_NAME = "//examples/{}".format(PRODUCT_NAME)
# Allow access from all //examples packages.
package(default_visibility = [
"//examples:__subpackages__",
])
load("@cef//bazel:library_helpers.bzl", "declare_cc_library", "declare_objc_library")
load("@rules_cc//cc:defs.bzl", "cc_library")
#
# Source file lists.
#
srcs_common = [
"app_factory.h",
"main_util.cc",
"main_util.h",
]
srcs_browser = [
"client_manager.cc",
"client_manager.h",
"client_util.cc",
"client_util.h",
"browser_util.cc",
"browser_util.h",
"main.h",
"resource_util.cc",
"resource_util.h",
]
srcs_browser_linux = [
"client_util_linux.cc",
"main_linux.cc",
"resource_util_linux.cc",
"resource_util_posix.cc",
]
srcs_browser_mac = [
"client_util_mac.mm",
"main_mac.mm",
"resource_util_mac.mm",
"resource_util_posix.cc",
]
srcs_browser_win = [
"client_util_win.cc",
"main_win.cc",
"resource_util_win.cc",
]
srcs_renderer = [
]
srcs_renderer_mac = [
"process_helper_mac.cc",
"process_helper_mac.h",
]
#
# MacOS targets.
#
filegroup(
name = "ResourcesMac",
srcs = [
"mac/English.lproj/InfoPlist.strings",
"mac/English.lproj/MainMenu.xib",
"mac/{}.icns".format(PRODUCT_NAME),
],
)
# Use alias() to allow file access from outside this package.
alias(
name = "Info.plist.in",
actual = "mac/Info.plist.in"
)
alias(
name = "helper-Info.plist.in",
actual = "mac/helper-Info.plist.in"
)
declare_objc_library(
name = "BrowserLibMac",
srcs = srcs_common + srcs_browser + srcs_browser_mac,
target_compatible_with = [
"@platforms//os:macos",
],
deps = [
"@cef//:cef_wrapper",
],
)
declare_cc_library(
name = "RendererLibMac",
srcs = srcs_common + srcs_renderer + srcs_renderer_mac,
target_compatible_with = [
"@platforms//os:macos",
],
deps = [
"@cef//:cef_wrapper",
],
)
#
# Windows targets.
#
filegroup(
name = "ResourcesWin",
srcs = [
"win/big.ico",
"win/shared.rc",
"win/small.ico",
],
)
# Headers used by win/shared.rc to be included by the declare_exe target.
cc_library(
name = "ResourceH",
hdrs = [
"win/resource.h",
],
deps = [
# For inclusion of the "include/cef_version.h" header.
"@cef//:cef_wrapper",
],
)
# Use alias() to allow file access from outside this package.
alias(
name = "compatibility.manifest",
actual = "win/compatibility.manifest"
)
alias(
name = "shared.exe.manifest",
actual = "win/shared.exe.manifest"
)
# Include files directly in the declare_exe target. This simplifies the build
# configuration and avoids issues with Windows discarding symbols (like WinMain)
# when linking libraries.
filegroup(
name = "SrcsWin",
srcs = srcs_common + srcs_browser + srcs_browser_win + srcs_renderer,
target_compatible_with = [
"@platforms//os:windows",
],
)
#
# Linux targets.
#
# Include files directly in the declare_exe target. This simplifies the build
# configuration.
filegroup(
name = "SrcsLinux",
srcs = srcs_common + srcs_browser + srcs_browser_linux + srcs_renderer,
target_compatible_with = [
"@platforms//os:linux",
],
)