-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy path002-buildflags-fixes.patch
258 lines (231 loc) · 7.93 KB
/
002-buildflags-fixes.patch
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
diff --git a/BUILD.gn b/BUILD.gn
index 964d51123..14bc8fb6c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -14,7 +14,10 @@ if (angle_has_build) {
import("//build/config/linux/pkg_config.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
- import("//testing/libfuzzer/fuzzer_test.gni")
+
+ if (use_fuzzing_engine) {
+ import("//testing/libfuzzer/fuzzer_test.gni")
+ }
if (is_android) {
# android/rules.gni can only be imported for Android targets
@@ -91,10 +94,14 @@ if (angle_build_all) {
":angle",
":angle_shader_translator",
":translator_fuzzer",
- ":xxhash_fuzzer",
"$angle_root/samples:angle_samples",
- "$angle_root/src/tests:angle_tests",
+ #"$angle_root/src/tests:angle_tests",
]
+ if (use_fuzzing_engine) {
+ deps += [
+ ":xxhash_fuzzer",
+ ]
+ }
if (angle_enable_cl) {
deps += [ "$angle_root/src/libOpenCL:angle_cl" ]
}
@@ -271,7 +278,7 @@ config("constructor_and_destructor_warnings") {
config("extra_warnings") {
cflags = []
- is_gcc = !is_clang && !is_win
+ is_gcc = !is_clang && !is_msvs
# Avoid failing builds for warnings enabled by Skia build.
if (defined(is_skia_standalone)) {
@@ -279,7 +286,7 @@ config("extra_warnings") {
}
# Enable more default warnings on Windows.
- if (is_win) {
+ if (is_msvs) {
cflags += [
"/we4244", # Conversion: possible loss of data.
"/we4312", # Conversion: greater size.
@@ -342,7 +349,7 @@ config("build_id_config") {
ldflags = [ "-Wl,--build-id" ]
}
-_use_copy_compiler_dll = angle_has_build && is_win
+_use_copy_compiler_dll = angle_has_build && is_msvs
if (_use_copy_compiler_dll) {
copy("copy_compiler_dll") {
@@ -451,7 +458,7 @@ angle_source_set("xxhash") {
}
}
-if (angle_has_build) {
+if (angle_has_build && use_fuzzing_engine) {
fuzzer_test("xxhash_fuzzer") {
sources = [ "src/common/third_party/xxhash/xxhash_fuzzer.cpp" ]
deps = [ ":xxhash" ]
@@ -616,9 +623,9 @@ angle_static_library("angle_gpu_info_util") {
if (is_win) {
sources += libangle_gpu_info_util_win_sources
if (!angle_is_winuwp) {
- libs += [ "setupapi.lib" ]
+ libs += [ "setupapi" ]
}
- libs += [ "dxgi.lib" ]
+ libs += [ "dxgi" ]
}
if (is_linux || is_chromeos) {
@@ -762,7 +769,7 @@ template("translator_lib") {
":angle_version_info",
]
- if (is_win) {
+ if (is_msvs) {
# Necessary to suppress some system header xtree warnings in Release.
# For some reason this warning doesn't get triggered in Chromium
cflags = [ "/wd4718" ]
@@ -949,7 +956,7 @@ config("libANGLE_config") {
ldflags = []
defines += [ "LIBANGLE_IMPLEMENTATION" ]
- if (is_win) {
+ if (is_msvs) {
cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics
# are not enabled.
}
@@ -1053,8 +1060,8 @@ angle_source_set("libANGLE_no_vulkan") {
if (is_win && !angle_is_winuwp) {
libs += [
- "gdi32.lib",
- "user32.lib",
+ "gdi32",
+ "user32",
]
}
@@ -1079,7 +1086,7 @@ angle_source_set("libANGLE_no_vulkan") {
}
if (angle_enable_d3d11) {
- libs += [ "dxguid.lib" ]
+ libs += [ "dxguid" ]
}
if (angle_enable_metal) {
@@ -1469,6 +1476,7 @@ if (angle_enable_gl_desktop_frontend) {
angle_static_library("libGLESv2_static") {
sources = libglesv2_sources
+ output_name = "libGLESv2"
if (angle_enable_gl_desktop_frontend) {
sources += libglesv2_gl_sources
defines = [ "ANGLE_ENABLE_GL_DESKTOP_FRONTEND" ]
@@ -1614,6 +1622,7 @@ if (angle_enable_vulkan) {
}
libEGL_template("libEGL_static") {
+ output_name = "libEGL"
target_type = "angle_static_library"
public_configs = [ ":angle_static_config" ]
deps = [ ":libGLESv2_static" ]
diff --git a/build_overrides/build.gni b/build_overrides/build.gni
index f9d54f2b3..40c1f8e63 100644
--- a/build_overrides/build.gni
+++ b/build_overrides/build.gni
@@ -42,7 +42,7 @@ limit_android_deps = true
# of hardening checks. To ensure performance remains competitive, drop the
# libc++ hardening checks, since ANGLE already makes no security guarantees in
# these situations.
-if (is_win) {
+if (is_msvs) {
# TODO(https://crbug.com/1418717): ANGLE uses Chromium's abseil-cpp directory.
# Since Abseil does not mark symbols as exported, Chromium uses an alternate
# approach to scrape the symbols that need to be exported and generates .def
diff --git a/gni/angle.gni b/gni/angle.gni
index e946c6b6f..8862dc2f7 100644
--- a/gni/angle.gni
+++ b/gni/angle.gni
@@ -48,7 +48,6 @@ if (angle_has_build) {
import("//build/config/ozone.gni") # import the ozone_platform_x11 variable
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")
- import("//testing/test.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
@@ -61,6 +60,12 @@ if (angle_has_build) {
angle_vulkan_display_mode = "headless"
}
+ if (is_mingw) {
+ declare_args() {
+ use_fuzzing_engine = false
+ }
+ }
+
declare_args() {
angle_use_gbm = ozone_platform_gbm
angle_use_x11 = ozone_platform_x11 && !is_ggp && (is_linux || is_chromeos)
@@ -197,7 +202,7 @@ declare_args() {
declare_args() {
# ASTC emulation is only built on standalone non-android builds
- angle_has_astc_encoder = angle_has_build && angle_standalone && !is_android
+ angle_has_astc_encoder = angle_has_build && angle_standalone && !is_android && !is_mingw
}
declare_args() {
@@ -274,7 +279,7 @@ declare_args() {
angle_vulkan_validation_layers_dir =
"$angle_root/third_party/vulkan-deps/vulkan-validation-layers/src"
- angle_build_vulkan_system_info = angle_has_build && !angle_is_winuwp
+ angle_build_vulkan_system_info = angle_has_build && angle_enable_vulkan && !angle_is_winuwp
# Enable overlay by default when debug layers are enabled. This is currently only implemented on
# Vulkan.
diff --git a/src/libANGLE/renderer/d3d/BUILD.gn b/src/libANGLE/renderer/d3d/BUILD.gn
index b5cbea8b7..054395801 100644
--- a/src/libANGLE/renderer/d3d/BUILD.gn
+++ b/src/libANGLE/renderer/d3d/BUILD.gn
@@ -27,14 +27,16 @@ angle_source_set("angle_d3d_shared") {
if (angle_enable_d3d9) {
config("angle_d3d9_backend_config") {
defines = [ "ANGLE_ENABLE_D3D9" ]
- ldflags = [ "/DELAYLOAD:d3d9.dll" ]
+ if (is_msvs) {
+ ldflags = [ "/DELAYLOAD:d3d9.dll" ]
+ }
}
angle_source_set("angle_d3d9_backend") {
sources = d3d9_backend_sources
libs = [
- "d3d9.lib",
- "delayimp.lib",
+ "d3d9",
+ "delayimp",
]
public_deps = [ ":angle_d3d_shared" ]
public_configs = [ ":angle_d3d9_backend_config" ]
@@ -52,7 +54,7 @@ if (angle_enable_d3d11) {
angle_source_set("angle_d3d11_backend") {
sources = d3d11_backend_sources
- libs = [ "dxguid.lib" ]
+ libs = [ "dxguid" ]
public_deps = [ ":angle_d3d_shared" ]
public_configs = [ ":angle_d3d11_backend_config" ]
diff --git a/src/tests/BUILD.gn b/src/tests/BUILD.gn
index 440d2e0dd..f686474b5 100644
--- a/src/tests/BUILD.gn
+++ b/src/tests/BUILD.gn
@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//build/config/chromecast_build.gni")
-import("//testing/test.gni")
import("../../gni/angle.gni")
import("angle_unittests.gni")
diff --git a/util/BUILD.gn b/util/BUILD.gn
index 89bfb5362..9a1fd3a07 100644
--- a/util/BUILD.gn
+++ b/util/BUILD.gn
@@ -379,7 +379,7 @@ foreach(is_shared_library,
}
}
-if (is_win && !angle_is_winuwp) {
+if (is_msvs && !angle_is_winuwp) {
angle_source_set("angle_stack_walker") {
sources = [
"windows/third_party/StackWalker/src/StackWalker.cpp",
@@ -435,7 +435,7 @@ angle_source_set("angle_test_utils") {
sources += [ "windows/test_utils_win.cpp" ]
if (angle_is_winuwp) {
sources += [ "windows/test_utils_winuwp.cpp" ]
- } else {
+ } else if (is_msvs) {
deps += [ ":angle_stack_walker" ]
sources += [ "windows/win32/test_utils_win32.cpp" ]
}