--- a/third_party/electron_node/BUILD.gn +++ b/third_party/electron_node/BUILD.gn @@ -45,6 +45,18 @@ node_module_version = "" } +if (is_linux) { + import("//build/config/linux/pkg_config.gni") + + pkg_config("cares") { + packages = [ "libcares" ] + } + + 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") @@ -198,13 +210,9 @@ component("node_lib") { deps = [ ":node_js2c", - "deps/cares", "deps/histogram", - "deps/http_parser", "deps/llhttp", - "deps/nghttp2", "deps/uvwasi", - "deps/zlib", "//third_party/brotli:dec", "//third_party/brotli:enc", "//v8:v8_libplatform", @@ -218,6 +226,21 @@ public_configs = [ ":node_lib_config" ] include_dirs = [ "src" ] libs = [] + if (is_linux) { + configs += [ + ":cares", + ":nghttp2", + ] + deps += [ "//third_party/zlib" ] + libs += [ "http_parser" ] + } else { + deps += [ + "deps/cares", + "deps/http_parser", + "deps/nghttp2", + "deps/zlib", + ] + } cflags_cc = [ "-Wno-deprecated-declarations", "-Wno-implicit-fallthrough",