Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 5c2ce97

Browse files
nornagonnitsakh
authored andcommitted
refactor: split out main config so inspector can share (#93)
1 parent 2509049 commit 5c2ce97

File tree

2 files changed

+59
-51
lines changed

2 files changed

+59
-51
lines changed

BUILD.gn

Lines changed: 57 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@ chdir_action("node_js2c") {
9898
args += rebase_path(macro_inputs + config_gypi)
9999
}
100100

101-
config("node_lib_config") {
102-
include_dirs = [ "src" ]
103-
104-
# FIXME(deepak1556): include paths should be corrected,
105-
# refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
106-
cflags = [ "-Wno-microsoft-include" ]
101+
config("node_features") {
107102
defines = []
108103
if (node_enable_inspector) {
109104
defines += [ "HAVE_INSPECTOR=1" ]
@@ -120,41 +115,32 @@ config("node_lib_config") {
120115
} else {
121116
defines += [ "NODE_HAVE_I18N_SUPPORT=0" ]
122117
}
118+
if (node_use_v8_platform) {
119+
defines += [ "NODE_USE_V8_PLATFORM=1" ]
120+
} else {
121+
defines += [ "NODE_USE_V8_PLATFORM=0" ]
122+
}
123123
}
124124

125-
component("node_lib") {
126-
deps = [
127-
":node_js2c",
128-
"deps/cares",
129-
"deps/http_parser",
130-
"deps/llhttp",
131-
"deps/nghttp2",
132-
"deps/zlib",
133-
"//v8:v8_libplatform",
134-
]
135-
public_deps = [
136-
"deps/uv",
137-
"//electron:atom_js2c",
138-
"//v8",
139-
]
140-
public_configs = [ ":node_lib_config" ]
125+
config("node_lib_config") {
141126
include_dirs = [ "src" ]
142-
libs = []
143-
cflags_cc = [
144-
"-Wno-deprecated-declarations",
145-
"-Wno-implicit-fallthrough",
146-
"-Wno-return-type",
147-
"-Wno-sometimes-uninitialized",
148-
"-Wno-string-plus-int",
149-
"-Wno-unused-label",
150-
"-Wno-unused-private-field",
151-
"-Wno-unused-variable",
127+
128+
# FIXME(deepak1556): include paths should be corrected,
129+
# refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
130+
cflags = [ "-Wno-microsoft-include" ]
131+
132+
configs = [ ":node_features" ]
133+
}
134+
135+
config("node_internal_config") {
136+
visibility = [
137+
":*",
138+
"src/inspector:*",
152139
]
153140
defines = [
154141
"NODE_WANT_INTERNALS=1",
155142
"NODE_IMPLEMENTATION",
156143
]
157-
158144
if (is_component_build) {
159145
defines += [
160146
"BUILDING_V8_SHARED",
@@ -199,6 +185,44 @@ component("node_lib") {
199185
defines += [ "NODE_RELEASE_URLBASE=\"$node_release_urlbase\"" ]
200186
}
201187

188+
if (node_use_openssl) {
189+
defines += [
190+
"NODE_OPENSSL_SYSTEM_CERT_PATH=\"$node_openssl_system_ca_path\"",
191+
"EVP_CTRL_CCM_SET_TAG=EVP_CTRL_GCM_SET_TAG",
192+
]
193+
}
194+
}
195+
196+
component("node_lib") {
197+
deps = [
198+
":node_js2c",
199+
"deps/cares",
200+
"deps/http_parser",
201+
"deps/llhttp",
202+
"deps/nghttp2",
203+
"deps/zlib",
204+
"//v8:v8_libplatform",
205+
]
206+
public_deps = [
207+
"deps/uv",
208+
"//electron:atom_js2c",
209+
"//v8",
210+
]
211+
configs += [ ":node_internal_config" ]
212+
public_configs = [ ":node_lib_config" ]
213+
include_dirs = [ "src" ]
214+
libs = []
215+
cflags_cc = [
216+
"-Wno-deprecated-declarations",
217+
"-Wno-implicit-fallthrough",
218+
"-Wno-return-type",
219+
"-Wno-sometimes-uninitialized",
220+
"-Wno-string-plus-int",
221+
"-Wno-unused-label",
222+
"-Wno-unused-private-field",
223+
"-Wno-unused-variable",
224+
]
225+
202226
if (v8_enable_i18n_support) {
203227
deps += [ "//third_party/icu" ]
204228
}
@@ -246,17 +270,8 @@ component("node_lib") {
246270
"src/tls_wrap.cc",
247271
"src/tls_wrap.h",
248272
]
249-
defines += [
250-
"NODE_OPENSSL_SYSTEM_CERT_PATH=\"$node_openssl_system_ca_path\"",
251-
"EVP_CTRL_CCM_SET_TAG=EVP_CTRL_GCM_SET_TAG",
252-
]
253273
cflags_cc += [ "-Wno-sign-compare" ]
254274
}
255-
if (node_use_v8_platform) {
256-
defines += [ "NODE_USE_V8_PLATFORM=1" ]
257-
} else {
258-
defines += [ "NODE_USE_V8_PLATFORM=0" ]
259-
}
260275
}
261276

262277
##### node_headers

src/inspector/BUILD.gn

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ config("inspector_config") {
2626
"$target_gen_dir/src",
2727
]
2828

29-
defines = [ "HAVE_INSPECTOR=1" ]
29+
configs = [ "../..:node_features" ]
3030
}
3131

3232
source_set("inspector") {
@@ -55,14 +55,7 @@ source_set("inspector") {
5555
"../../deps/uv",
5656
"//third_party/icu:icuuc",
5757
]
58-
defines = [ "NODE_WANT_INTERNALS=1" ]
59-
if (is_component_build) {
60-
defines += [
61-
"BUILDING_V8_SHARED",
62-
"BUILDING_V8_PLATFORM_SHARED",
63-
"BUILDING_V8_BASE_SHARED",
64-
]
65-
}
58+
configs += [ "../..:node_internal_config" ]
6659
public_configs = [ ":inspector_config" ]
6760
}
6861

0 commit comments

Comments
 (0)