-
Notifications
You must be signed in to change notification settings - Fork 15.1k
/
build_add_gn_build_files.patch
2707 lines (2657 loc) · 88.1 KB
/
build_add_gn_build_files.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Tue, 26 Feb 2019 17:07:45 -0800
Subject: build: add GN build files
This adds GN build files for Node, so we don't have to build with GYP.
Note that there always GN files in upstream Node in 20/21 branches,
however those files were cherry-picked from main branch and do not
really in 20/21. We have to wait until 22 is released to be able to
build with upstream GN files.
diff --git a/BUILD.gn b/BUILD.gn
index 1ed186b597eece7c34cb69c8e1e20870555a040d..541e7d2b8ee05677b64a3ea39c1422560fd5df75 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1,14 +1,404 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+import("//v8/gni/v8.gni")
+import("//electron/js2c_toolchain.gni")
+import("electron_node.gni")
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+declare_args() {
+ # Enable the V8 inspector protocol for use with node.
+ node_enable_inspector = true
-import("unofficial.gni")
+ # Build node with SSL support.
+ # The variable is called "openssl" for parity with node's GYP build.
+ node_use_openssl = true
-node_gn_build("node") {
+ # Use the specified path to system CA (PEM format) in addition to
+ # the BoringSSL supplied CA store or compiled-in Mozilla CA copy.
+ node_openssl_system_ca_path = ""
+
+ # Initialize v8 platform during node.js startup.
+ # NB. this must be turned off in Electron, because Electron initializes the
+ # v8 platform itself.
+ node_use_v8_platform = false
+
+ # Build with DTrace support.
+ node_use_dtrace = false
+
+ # Build with ETW support.
+ node_use_etw = false
+
+ # Build JavaScript in lib/ with DCHECK macros.
+ node_debug_lib = false
+
+ # Custom build tag.
+ node_tag = ""
+
+ # V8 options to pass, see `node --v8-options` for examples
+ node_v8_options = ""
+
+ # Provide a custom URL prefix for the `process.release` properties
+ # `sourceUrl` and `headersUrl`. When compiling a release build, this will
+ # default to https://nodejs.org/download/release/')
+ node_release_urlbase = ""
+
+ # Allows downstream packagers (eg. Linux distributions) to build Electron against system shared libraries.
+ use_system_cares = false
+ use_system_nghttp2 = false
+ use_system_llhttp = false
+ use_system_histogram = false
+}
+
+if (is_linux) {
+ import("//build/config/linux/pkg_config.gni")
+ if (use_system_cares) {
+ pkg_config("cares") {
+ packages = [ "libcares" ]
+ }
+ }
+ if (use_system_nghttp2) {
+ pkg_config("nghttp2") {
+ packages = [ "libnghttp2" ]
+ }
+ }
+}
+
+assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
+assert(!node_use_etw, "node_use_etw not supported in GN")
+
+assert(!node_enable_inspector || node_use_openssl,
+ "node_enable_inspector requires node_use_openssl")
+
+config("node_internals") {
+ defines = [ "NODE_WANT_INTERNALS=1" ]
+}
+
+node_files = read_file("filenames.json", "json")
+library_files = node_files.library_files
+fs_files = node_files.fs_files
+original_fs_files = []
+foreach(file, fs_files) {
+ original_fs_files += [string_replace(string_replace(file, "internal/fs/", "internal/original-fs/"), "lib/fs.js", "lib/original-fs.js")]
+}
+
+copy("node_js2c_inputs") {
+ sources = library_files
+ outputs = [
+ "$target_gen_dir/js2c_inputs/{{source_target_relative}}",
+ ]
+}
+
+action("node_js2c_original_fs") {
+ script = "tools/generate_original_fs.py"
+ inputs = fs_files
+ outputs = []
+ foreach(file, fs_files + original_fs_files) {
+ outputs += ["$target_gen_dir/js2c_inputs/$file"]
+ }
+
+ args = [rebase_path("$target_gen_dir/js2c_inputs")] + fs_files
+}
+
+action("node_js2c_exec") {
+ deps = [
+ "//electron:generate_config_gypi",
+ ":node_js2c_original_fs",
+ ":node_js2c_inputs",
+ ":node_js2c($electron_js2c_toolchain)"
+ ]
+ config_gypi = [ "$root_gen_dir/config.gypi" ]
+ inputs = library_files + get_target_outputs(":node_js2c_original_fs") + config_gypi
+ outputs = [
+ "$target_gen_dir/node_javascript.cc",
+ ]
+
+ script = "//electron/build/run-in-dir.py"
+ out_dir = get_label_info(":anything($electron_js2c_toolchain)", "root_out_dir")
+ args = [ rebase_path("$target_gen_dir/js2c_inputs"), rebase_path("$out_dir/node_js2c") ] +
+ rebase_path(outputs) + library_files + fs_files + original_fs_files + rebase_path(config_gypi)
+}
+
+config("node_features") {
+ defines = []
+ if (node_enable_inspector) {
+ defines += [ "HAVE_INSPECTOR=1" ]
+ } else {
+ defines += [ "HAVE_INSPECTOR=0" ]
+ }
+ if (node_use_openssl) {
+ defines += [ "HAVE_OPENSSL=1" ]
+ } else {
+ defines += [ "HAVE_OPENSSL=0" ]
+ }
+ if (v8_enable_i18n_support) {
+ defines += [ "NODE_HAVE_I18N_SUPPORT=1" ]
+ } else {
+ defines += [ "NODE_HAVE_I18N_SUPPORT=0" ]
+ }
+ if (node_use_v8_platform) {
+ defines += [ "NODE_USE_V8_PLATFORM=1" ]
+ } else {
+ defines += [ "NODE_USE_V8_PLATFORM=0" ]
+ }
+}
+
+config("node_lib_config") {
+ include_dirs = [ "src" ]
+
+ cflags = [
+ "-Wno-shadow",
+ # FIXME(deepak1556): include paths should be corrected,
+ # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
+ "-Wno-microsoft-include",
+ ]
+
+ configs = [ ":node_features" ]
+
+ if (is_debug) {
+ defines = [ "DEBUG" ]
+ }
+}
+
+config("node_internal_config") {
+ visibility = [
+ ":*",
+ "src/inspector:*",
+ ]
+ defines = [
+ "NODE_WANT_INTERNALS=1",
+ "NODE_IMPLEMENTATION",
+ ]
+ if (node_module_version != "") {
+ defines += [ "NODE_EMBEDDER_MODULE_VERSION=" + node_module_version ]
+ }
+ if (is_component_build) {
+ defines += [
+ "NODE_SHARED_MODE",
+ ]
+ }
+
+ if (target_cpu == "x86") {
+ node_arch = "ia32"
+ } else {
+ node_arch = target_cpu
+ }
+ defines += [ "NODE_ARCH=\"$node_arch\"" ]
+
+ if (target_os == "win") {
+ node_platform = "win32"
+ } else if (target_os == "mac") {
+ node_platform = "darwin"
+ } else {
+ node_platform = target_os
+ }
+ defines += [ "NODE_PLATFORM=\"$node_platform\"" ]
+
+ if (is_win) {
+ defines += [
+ "NOMINMAX",
+ "_UNICODE=1",
+ ]
+ } else {
+ defines += [ "__POSIX__" ]
+ }
+
+ if (node_tag != "") {
+ defines += [ "NODE_TAG=\"$node_tag\"" ]
+ }
+ if (node_v8_options != "") {
+ defines += [ "NODE_V8_OPTIONS=\"$node_v8_options\"" ]
+ }
+ if (node_release_urlbase != "") {
+ defines += [ "NODE_RELEASE_URLBASE=\"$node_release_urlbase\"" ]
+ }
+
+ if (node_use_openssl) {
+ defines += [
+ "NODE_OPENSSL_SYSTEM_CERT_PATH=\"$node_openssl_system_ca_path\"",
+ "EVP_CTRL_CCM_SET_TAG=EVP_CTRL_GCM_SET_TAG",
+ ]
+ }
+}
+
+executable("overlapped-checker") {
+ sources = []
+ if (is_win) {
+ sources += [ "test/overlapped-checker/main_win.c" ]
+ } else {
+ sources += [ "test/overlapped-checker/main_unix.c" ]
+ }
+}
+
+if (current_toolchain == electron_js2c_toolchain) {
+ executable("node_js2c") {
+ defines = []
+ sources = [
+ "tools/js2c.cc",
+ "tools/executable_wrapper.h"
+ ]
+ include_dirs = [ "tools" ]
+ deps = [
+ "deps/simdutf($electron_js2c_toolchain)",
+ "deps/uv($electron_js2c_toolchain)",
+ "//v8"
+ ]
+
+ if (!is_win) {
+ defines += [ "NODE_JS2C_USE_STRING_LITERALS" ]
+ }
+ if (is_debug) {
+ cflags_cc = [ "-g", "-O0" ]
+ defines += [ "DEBUG" ]
+ }
+ }
+}
+
+component("node_lib") {
+ deps = [
+ ":node_js2c_exec",
+ "deps/googletest:gtest",
+ "deps/ada",
+ "deps/base64",
+ "deps/simdutf",
+ "deps/uvwasi",
+ "//third_party/zlib",
+ "//third_party/brotli:dec",
+ "//third_party/brotli:enc",
+ "//v8:v8_libplatform",
+ ]
+ if (use_system_cares) {
+ configs += [ ":cares" ]
+ } else {
+ deps += [ "deps/cares" ]
+ }
+ if (use_system_nghttp2) {
+ configs += [ ":nghttp2" ]
+ } else {
+ deps += [ "deps/nghttp2" ]
+ }
+ public_deps = [
+ "deps/uv",
+ "//electron:electron_js2c",
+ "//v8",
+ ]
+ configs += [ ":node_internal_config" ]
+ public_configs = [ ":node_lib_config" ]
+ include_dirs = [
+ "src",
+ "deps/postject"
+ ]
+ libs = []
+ if (use_system_llhttp) {
+ libs += [ "llhttp" ]
+ } else {
+ deps += [ "deps/llhttp" ]
+ }
+ if (use_system_histogram) {
+ libs += [ "hdr_histogram" ]
+ include_dirs += [ "/usr/include/hdr" ]
+ } else {
+ deps += [ "deps/histogram" ]
+ }
+ frameworks = []
+ cflags_cc = [
+ "-Wno-deprecated-declarations",
+ "-Wno-implicit-fallthrough",
+ "-Wno-return-type",
+ "-Wno-sometimes-uninitialized",
+ "-Wno-string-plus-int",
+ "-Wno-unused-function",
+ "-Wno-unused-label",
+ "-Wno-unused-private-field",
+ "-Wno-unused-variable",
+ ]
+
+ if (v8_enable_i18n_support) {
+ deps += [ "//third_party/icu" ]
+ }
+
+ sources = node_files.node_sources
+ sources += [
+ "$root_gen_dir/electron_natives.cc",
+ "$target_gen_dir/node_javascript.cc",
+ "src/node_snapshot_stub.cc",
+ ]
+
+ if (is_win) {
+ libs += [ "psapi.lib" ]
+ }
+ if (is_mac) {
+ frameworks += [ "CoreFoundation.framework" ]
+ }
+
+ if (node_enable_inspector) {
+ sources += [
+ "src/inspector_agent.cc",
+ "src/inspector_agent.h",
+ "src/inspector_io.cc",
+ "src/inspector_io.h",
+ "src/inspector_js_api.cc",
+ "src/inspector_profiler.cc",
+ "src/inspector_socket.cc",
+ "src/inspector_socket.h",
+ "src/inspector_socket_server.cc",
+ "src/inspector_socket_server.h",
+ ]
+ deps += [ "src/inspector" ]
+ }
+
+ if (node_use_openssl) {
+ deps += [ "//third_party/boringssl" ]
+ sources += [
+ "src/crypto/crypto_aes.cc",
+ "src/crypto/crypto_aes.h",
+ "src/crypto/crypto_bio.cc",
+ "src/crypto/crypto_bio.h",
+ "src/crypto/crypto_cipher.cc",
+ "src/crypto/crypto_cipher.h",
+ "src/crypto/crypto_clienthello-inl.h",
+ "src/crypto/crypto_clienthello.cc",
+ "src/crypto/crypto_clienthello.h",
+ "src/crypto/crypto_common.cc",
+ "src/crypto/crypto_common.h",
+ "src/crypto/crypto_context.cc",
+ "src/crypto/crypto_context.h",
+ "src/crypto/crypto_dh.cc",
+ "src/crypto/crypto_dh.h",
+ "src/crypto/crypto_dsa.cc",
+ "src/crypto/crypto_dsa.h",
+ "src/crypto/crypto_ec.cc",
+ "src/crypto/crypto_ec.h",
+ "src/crypto/crypto_groups.h",
+ "src/crypto/crypto_hash.cc",
+ "src/crypto/crypto_hash.h",
+ "src/crypto/crypto_hkdf.cc",
+ "src/crypto/crypto_hkdf.h",
+ "src/crypto/crypto_hmac.cc",
+ "src/crypto/crypto_hmac.h",
+ "src/crypto/crypto_keygen.cc",
+ "src/crypto/crypto_keygen.h",
+ "src/crypto/crypto_keys.cc",
+ "src/crypto/crypto_keys.h",
+ "src/crypto/crypto_pbkdf2.cc",
+ "src/crypto/crypto_pbkdf2.h",
+ "src/crypto/crypto_random.cc",
+ "src/crypto/crypto_random.h",
+ "src/crypto/crypto_rsa.cc",
+ "src/crypto/crypto_rsa.h",
+ "src/crypto/crypto_scrypt.cc",
+ "src/crypto/crypto_scrypt.h",
+ "src/crypto/crypto_sig.cc",
+ "src/crypto/crypto_sig.h",
+ "src/crypto/crypto_spkac.cc",
+ "src/crypto/crypto_spkac.h",
+ "src/crypto/crypto_timing.cc",
+ "src/crypto/crypto_timing.h",
+ "src/crypto/crypto_tls.cc",
+ "src/crypto/crypto_tls.h",
+ "src/crypto/crypto_util.cc",
+ "src/crypto/crypto_util.h",
+ "src/crypto/crypto_x509.cc",
+ "src/crypto/crypto_x509.h",
+ "src/node_crypto.cc",
+ "src/node_crypto.h",
+ ]
+ cflags_cc += [ "-Wno-sign-compare" ]
+ }
}
diff --git a/deps/ada/BUILD.gn b/deps/ada/BUILD.gn
index e92ac3a3beac143dced2efb05304ed8ba832b067..1ce69e9deba1a9b191e8d95f4c82e0ec1f7b50ca 100644
--- a/deps/ada/BUILD.gn
+++ b/deps/ada/BUILD.gn
@@ -1,14 +1,12 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+import("//v8/gni/v8.gni")
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+config("ada_config") {
+ include_dirs = [ "." ]
+}
-import("unofficial.gni")
+static_library("ada") {
+ include_dirs = [ "." ]
+ sources = [ "ada.cpp" ]
-ada_gn_build("ada") {
+ public_configs = [ ":ada_config" ]
}
diff --git a/deps/base64/unofficial.gni b/deps/base64/unofficial.gni
index 269c62d976d6adea6d020568094e23e9b0a9dc7c..14ffff0b4badb7ad71f2b6df43ad2eb300fc55ed 100644
--- a/deps/base64/unofficial.gni
+++ b/deps/base64/unofficial.gni
@@ -18,6 +18,10 @@ template("base64_gn_build") {
}
}
+ # FIXME(zcbenz): ASM on win/x86 compiles perfectly in upstream Node, figure
+ # out why it does not work in Electron's build configs.
+ support_x86_asm = target_cpu == "x64" || (target_cpu == "x86" && !is_win)
+
config("base64_internal_config") {
include_dirs = [ "base64/lib" ]
if (is_component_build) {
@@ -25,7 +29,7 @@ template("base64_gn_build") {
} else {
defines = []
}
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
defines += [
"HAVE_SSSE3=1",
"HAVE_SSE41=1",
@@ -75,7 +79,7 @@ template("base64_gn_build") {
source_set("base64_ssse3") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/ssse3/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mssse3" ]
}
@@ -85,7 +89,7 @@ template("base64_gn_build") {
source_set("base64_sse41") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/sse41/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-msse4.1" ]
}
@@ -95,7 +99,7 @@ template("base64_gn_build") {
source_set("base64_sse42") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/sse42/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-msse4.2" ]
}
@@ -105,7 +109,7 @@ template("base64_gn_build") {
source_set("base64_avx") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mavx" ]
} else if (is_win) {
@@ -117,7 +121,7 @@ template("base64_gn_build") {
source_set("base64_avx2") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx2/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mavx2" ]
} else if (is_win) {
@@ -129,7 +133,7 @@ template("base64_gn_build") {
source_set("base64_avx512") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx512/codec.c" ]
- if (target_cpu == "x86" || target_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [
"-mavx512vl",
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..fb1b3138cdb674205afa0ffe078270585843eca3 100644
--- a/deps/cares/BUILD.gn
+++ b/deps/cares/BUILD.gn
@@ -1,14 +1,143 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("cares_config") {
+ include_dirs = [ "include", "src/lib" ]
+}
+static_library("cares") {
+ defines = [ "CARES_STATICLIB" ]
+ include_dirs = [ "include" ]
+ public_configs = [ ":cares_config" ]
+
+ libs = []
+ cflags_c = [
+ "-Wno-logical-not-parentheses",
+ "-Wno-implicit-fallthrough",
+ "-Wno-sign-compare",
+ ]
+
+ sources = [
+ "include/ares.h",
+ "include/ares_dns.h",
+ "include/ares_nameser.h",
+ "include/ares_rules.h",
+ "include/ares_version.h",
+ "src/lib/ares__addrinfo2hostent.c",
+ "src/lib/ares__addrinfo_localhost.c",
+ "src/lib/ares_android.c",
+ "src/lib/ares__buf.c",
+ "src/lib/ares__buf.h",
+ "src/lib/ares__close_sockets.c",
+ "src/lib/ares__htable.c",
+ "src/lib/ares__htable.h",
+ "src/lib/ares__htable_asvp.c",
+ "src/lib/ares__htable_asvp.h",
+ "src/lib/ares__htable_stvp.c",
+ "src/lib/ares__htable_stvp.h",
+ "src/lib/ares__llist.c",
+ "src/lib/ares__llist.h",
+ "src/lib/ares__get_hostent.c",
+ "src/lib/ares__parse_into_addrinfo.c",
+ "src/lib/ares__read_line.c",
+ "src/lib/ares__readaddrinfo.c",
+ "src/lib/ares__slist.c",
+ "src/lib/ares__slist.h",
+ "src/lib/ares__sortaddrinfo.c",
+ "src/lib/ares__timeval.c",
+ "src/lib/ares_cancel.c",
+ "src/lib/ares_create_query.c",
+ "src/lib/ares_data.c",
+ "src/lib/ares_data.h",
+ "src/lib/ares_destroy.c",
+ "src/lib/ares_expand_name.c",
+ "src/lib/ares_expand_string.c",
+ "src/lib/ares_fds.c",
+ "src/lib/ares_free_hostent.c",
+ "src/lib/ares_free_string.c",
+ "src/lib/ares_freeaddrinfo.c",
+ "src/lib/ares_getaddrinfo.c",
+ "src/lib/ares_getenv.h",
+ "src/lib/ares_gethostbyaddr.c",
+ "src/lib/ares_gethostbyname.c",
+ "src/lib/ares_getnameinfo.c",
+ "src/lib/ares_getsock.c",
+ "src/lib/ares_inet_net_pton.h",
+ "src/lib/ares_init.c",
+ "src/lib/ares_ipv6.h",
+ "src/lib/ares_library_init.c",
+ "src/lib/ares_library_init.h",
+ "src/lib/ares_mkquery.c",
+ "src/lib/ares_nameser.h",
+ "src/lib/ares_nowarn.c",
+ "src/lib/ares_nowarn.h",
+ "src/lib/ares_options.c",
+ "src/lib/ares_parse_aaaa_reply.c",
+ "src/lib/ares_parse_a_reply.c",
+ "src/lib/ares_parse_caa_reply.c",
+ "src/lib/ares_parse_mx_reply.c",
+ "src/lib/ares_parse_naptr_reply.c",
+ "src/lib/ares_parse_ns_reply.c",
+ "src/lib/ares_parse_ptr_reply.c",
+ "src/lib/ares_parse_soa_reply.c",
+ "src/lib/ares_parse_srv_reply.c",
+ "src/lib/ares_parse_txt_reply.c",
+ "src/lib/ares_parse_uri_reply.c",
+ "src/lib/ares_platform.h",
+ "src/lib/ares_private.h",
+ "src/lib/ares_process.c",
+ "src/lib/ares_query.c",
+ "src/lib/ares_rand.c",
+ "src/lib/ares_search.c",
+ "src/lib/ares_send.c",
+ "src/lib/ares_setup.h",
+ "src/lib/ares_strcasecmp.c",
+ "src/lib/ares_strcasecmp.h",
+ "src/lib/ares_strdup.c",
+ "src/lib/ares_strdup.h",
+ "src/lib/ares_strerror.c",
+ "src/lib/ares_strsplit.c",
+ "src/lib/ares_timeout.c",
+ "src/lib/ares_version.c",
+ "src/lib/bitncmp.c",
+ "src/lib/bitncmp.h",
+ "src/lib/inet_net_pton.c",
+ "src/lib/inet_ntop.c",
+ "src/lib/setup_once.h",
+ "src/tools/ares_getopt.c",
+ "src/tools/ares_getopt.h",
+ ]
+
+ if (!is_win) {
+ defines += [
+ "_DARWIN_USE_64_BIT_INODE=1",
+ "_LARGEFILE_SOURCE",
+ "_FILE_OFFSET_BITS=64",
+ "_GNU_SOURCE",
+ ]
+ }
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ if (is_win) {
+ defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
+ include_dirs += [ "config/win32" ]
+ sources += [
+ "src/lib/ares_getenv.c",
+ "src/lib/ares_iphlpapi.h",
+ "src/lib/ares_platform.c",
+ "src/lib/config-win32.h",
+ "src/lib/windows_port.c",
+ ]
+ libs += [
+ "ws2_32.lib",
+ "iphlpapi.lib",
+ ]
+ } else {
+ defines += [ "HAVE_CONFIG_H" ]
+ }
-import("unofficial.gni")
+ if (is_linux) {
+ include_dirs += [ "config/linux" ]
+ sources += [ "config/linux/ares_config.h" ]
+ }
-cares_gn_build("cares") {
+ if (is_mac) {
+ include_dirs += [ "config/darwin" ]
+ sources += [ "config/darwin/ares_config.h" ]
+ }
}
diff --git a/deps/googletest/BUILD.gn b/deps/googletest/BUILD.gn
index de13f3f653b5d53610f4611001c10dce332293c2..0daf8c006cef89e76d7eccec3e924bd2718021c9 100644
--- a/deps/googletest/BUILD.gn
+++ b/deps/googletest/BUILD.gn
@@ -1,14 +1,64 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("gtest_config") {
+ include_dirs = [ "include" ]
+ defines = [ "UNIT_TEST" ]
+}
+
+static_library("gtest") {
+ include_dirs = [
+ "include",
+ "." # src
+ ]
+
+ public_configs = [ ":gtest_config" ]
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ cflags_cc = [
+ "-Wno-c++98-compat-extra-semi",
+ "-Wno-unused-const-variable",
+ "-Wno-unreachable-code-return",
+ ]
-import("unofficial.gni")
+ defines = [
+ "GTEST_HAS_POSIX_RE=0",
+ "GTEST_LANG_CXX11=1",
+ ]
+
+ sources = [
+ "include/gtest/gtest_pred_impl.h",
+ "include/gtest/gtest_prod.h",
+ "include/gtest/gtest-death-test.h",
+ "include/gtest/gtest-matchers.h",
+ "include/gtest/gtest-message.h",
+ "include/gtest/gtest-param-test.h",
+ "include/gtest/gtest-printers.h",
+ "include/gtest/gtest-spi.h",
+ "include/gtest/gtest-test-part.h",
+ "include/gtest/gtest-typed-test.h",
+ "include/gtest/gtest.h",
+ "include/gtest/internal/gtest-death-test-internal.h",
+ "include/gtest/internal/gtest-filepath.h",
+ "include/gtest/internal/gtest-internal.h",
+ "include/gtest/internal/gtest-param-util.h",
+ "include/gtest/internal/gtest-port-arch.h",
+ "include/gtest/internal/gtest-port.h",
+ "include/gtest/internal/gtest-string.h",
+ "include/gtest/internal/gtest-type-util.h",
+ "include/gtest/internal/custom/gtest-port.h",
+ "include/gtest/internal/custom/gtest-printers.h",
+ "include/gtest/internal/custom/gtest.h",
+ "src/gtest-all.cc",
+ "src/gtest-death-test.cc",
+ "src/gtest-filepath.cc",
+ "src/gtest-internal-inl.h",
+ "src/gtest-matchers.cc",
+ "src/gtest-port.cc",
+ "src/gtest-printers.cc",
+ "src/gtest-test-part.cc",
+ "src/gtest-typed-test.cc",
+ "src/gtest.cc",
+ ]
+}
-googletest_gn_build("googletest") {
+static_library("gtest_main") {
+ deps = [ ":gtest" ]
+ sources = [ "src/gtest_main.cc" ]
}
diff --git a/deps/histogram/BUILD.gn b/deps/histogram/BUILD.gn
index e2f3ee37137a6b7d45cbe79f8b9ba7f693ffc4d3..85467b372f01cf602af45fa2f0d599acabfc2310 100644
--- a/deps/histogram/BUILD.gn
+++ b/deps/histogram/BUILD.gn
@@ -1,14 +1,19 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("histogram_config") {
+ include_dirs = [ "include" ]
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ cflags = [
+ "-Wno-implicit-function-declaration",
+ "-Wno-incompatible-pointer-types",
+ "-Wno-unused-function",
+ "-Wno-atomic-alignment",
+ ]
+}
-import("unofficial.gni")
+static_library("histogram") {
+ public_configs = [ ":histogram_config" ]
-histogram_gn_build("histogram") {
+ sources = [
+ "src/hdr_histogram.c",
+ "src/hdr_histogram.h",
+ ]
}
diff --git a/deps/llhttp/BUILD.gn b/deps/llhttp/BUILD.gn
index 64a2a4799d5530276f46aa1faa63ece063390ada..fb000f8ee7647c375bc190d1729d67bb7770d109 100644
--- a/deps/llhttp/BUILD.gn
+++ b/deps/llhttp/BUILD.gn
@@ -1,14 +1,15 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
-
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
-
-import("unofficial.gni")
+config("llhttp_config") {
+ include_dirs = [ "include" ]
+ cflags = [ "-Wno-unreachable-code" ]
+}
-llhttp_gn_build("llhttp") {
+static_library("llhttp") {
+ include_dirs = [ "include" ]
+ public_configs = [ ":llhttp_config" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ sources = [
+ "src/api.c",
+ "src/http.c",
+ "src/llhttp.c",
+ ]
}
diff --git a/deps/nghttp2/BUILD.gn b/deps/nghttp2/BUILD.gn
index 274352b0e2449f8db49d9a49c6b92a69f97e8363..7d2ca477db2415f43ababa270d8aefa3124b2765 100644
--- a/deps/nghttp2/BUILD.gn
+++ b/deps/nghttp2/BUILD.gn
@@ -1,14 +1,51 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
-
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+config("nghttp2_config") {
+ defines = [ "NGHTTP2_STATICLIB" ]
+ include_dirs = [ "lib/includes" ]
+}
+static_library("nghttp2") {
+ public_configs = [ ":nghttp2_config" ]
+ defines = [
+ "_U_",
+ "BUILDING_NGHTTP2",
+ "NGHTTP2_STATICLIB",
+ "HAVE_CONFIG_H",
+ ]
+ include_dirs = [ "lib/includes" ]
-import("unofficial.gni")
+ cflags_c = [
+ "-Wno-implicit-function-declaration",
+ "-Wno-implicit-fallthrough",
+ "-Wno-string-plus-int",
+ "-Wno-unreachable-code-return",
+ "-Wno-unused-but-set-variable",
+ ]
-nghttp2_gn_build("nghttp2") {
+ sources = [
+ "lib/nghttp2_buf.c",
+ "lib/nghttp2_callbacks.c",
+ "lib/nghttp2_debug.c",
+ "lib/nghttp2_extpri.c",
+ "lib/nghttp2_frame.c",
+ "lib/nghttp2_hd.c",
+ "lib/nghttp2_hd_huffman.c",
+ "lib/nghttp2_hd_huffman_data.c",
+ "lib/nghttp2_helper.c",
+ "lib/nghttp2_http.c",
+ "lib/nghttp2_map.c",
+ "lib/nghttp2_mem.c",
+ "lib/nghttp2_npn.c",
+ "lib/nghttp2_option.c",
+ "lib/nghttp2_outbound_item.c",
+ "lib/nghttp2_pq.c",
+ "lib/nghttp2_priority_spec.c",
+ "lib/nghttp2_queue.c",
+ "lib/nghttp2_ratelim.c",
+ "lib/nghttp2_rcbuf.c",
+ "lib/nghttp2_session.c",
+ "lib/nghttp2_stream.c",
+ "lib/nghttp2_submit.c",
+ "lib/nghttp2_time.c",
+ "lib/nghttp2_version.c",
+ "lib/sfparse.c"
+ ]
}
diff --git a/deps/simdjson/BUILD.gn b/deps/simdjson/BUILD.gn
index d0580ccf354d2000fb0075fd3bb4579f93477927..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/deps/simdjson/BUILD.gn
+++ b/deps/simdjson/BUILD.gn
@@ -1,14 +0,0 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
-
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
-
-import("unofficial.gni")
-
-simdjson_gn_build("simdjson") {
-}
diff --git a/deps/simdutf/BUILD.gn b/deps/simdutf/BUILD.gn
index 119d49456911e99944294bd00b3f182a8f0e35b5..ce38c3633a228306622a7237067393d25332c59c 100644
--- a/deps/simdutf/BUILD.gn
+++ b/deps/simdutf/BUILD.gn
@@ -1,14 +1,21 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("simdutf_config") {
+ include_dirs = [ "." ]
+}
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+static_library("simdutf") {
+ include_dirs = [ "." ]
+ sources = [
+ "simdutf.cpp",
+ ]
-import("unofficial.gni")
+ public_configs = [ ":simdutf_config" ]
-simdutf_gn_build("simdutf") {
+ cflags_cc = [
+ "-Wno-ambiguous-reversed-operator",
+ "-Wno-c++98-compat-extra-semi",
+ "-Wno-unreachable-code",
+ "-Wno-unreachable-code-break",
+ "-Wno-unused-const-variable",
+ "-Wno-unused-function",
+ ]
}
diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn
index 8e6ac27048b5965e20f35c7a63e469beb6fa5970..7518168141db7958550c7f5dc1ed17ccdbbe4a60 100644
--- a/deps/uv/BUILD.gn
+++ b/deps/uv/BUILD.gn
@@ -1,14 +1,194 @@
-##############################################################################
-# #
-# DO NOT EDIT THIS FILE! #
-# #
-##############################################################################
+config("libuv_config") {
+ include_dirs = [ "include" ]
-# This file is used by GN for building, which is NOT the build system used for
-# building official binaries.
-# Please modify the gyp files if you are making changes to build system.
+ defines = []
-import("unofficial.gni")
+ if (is_linux) {
+ defines += [ "_POSIX_C_SOURCE=200112" ]
+ }
+ if (!is_win) {
+ defines += [
+ "_LARGEFILE_SOURCE",
+ "_FILE_OFFSET_BITS=64",
+ ]
+ }
+ if (is_mac) {
+ defines += [ "_DARWIN_USE_64_BIT_INODE=1" ]
+ }
+}
+
+static_library("uv") {
+ include_dirs = [
+ "include",
+ "src",
+ ]
+