File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,12 @@ declare_args() {
6262
6363 # Build with Amaro (TypeScript utils).
6464 node_use_amaro = true
65+
66+ # Allows downstream packagers (eg. Linux distributions) to build against system shared libraries.
67+ use_system_cares = false
68+ use_system_nghttp2 = false
69+ use_system_llhttp = false
70+ use_system_histogram = false
6571}
6672
6773assert (! node_enable_inspector || node_use_openssl ,
Original file line number Diff line number Diff line change @@ -153,7 +153,6 @@ template("node_gn_build") {
153153 " deps/brotli" ,
154154 " deps/cares" ,
155155 " deps/histogram" ,
156- " deps/llhttp" ,
157156 " deps/nbytes" ,
158157 " deps/nghttp2" ,
159158 " deps/ngtcp2" ,
@@ -179,7 +178,17 @@ template("node_gn_build") {
179178 configs -= [ " //build/config/gcc:symbol_visibility_hidden" ]
180179 configs += [ " //build/config/gcc:symbol_visibility_default" ]
181180 }
182-
181+ if (use_system_llhttp ) {
182+ libs += [ " llhttp" ]
183+ } else {
184+ deps += [ " deps/llhttp" ]
185+ }
186+ if (use_system_histogram ) {
187+ libs += [ " hdr_histogram" ]
188+ include_dirs += [ " /usr/include/hdr" ]
189+ } else {
190+ deps += [ " deps/histogram" ]
191+ }
183192 if (v8_enable_i18n_support ) {
184193 deps += [ " //third_party/icu" ]
185194 }
@@ -206,6 +215,19 @@ template("node_gn_build") {
206215 sources += node_inspector .node_inspector_sources +
207216 node_inspector .node_inspector_generated_sources
208217 }
218+ if (is_linux ) {
219+ import (" //build/config/linux/pkg_config.gni" )
220+ if (use_system_cares ) {
221+ pkg_config (" cares" ) {
222+ packages = [ " libcares" ]
223+ }
224+ }
225+ if (use_system_nghttp2 ) {
226+ pkg_config (" nghttp2" ) {
227+ packages = [ " libnghttp2" ]
228+ }
229+ }
230+ }
209231 }
210232
211233 executable (target_name ) {
You can’t perform that action at this time.
0 commit comments