Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 40 additions & 27 deletions deps/brotli/unofficial.gni
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,49 @@

# The actual configurations are put inside a template in unofficial.gni to
# prevent accidental edits from contributors.
template("brotli_gn_build") {
config("brotli_config") {
include_dirs = [ "c/include" ]
}
import("../../node.gni")

gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("brotli.gyp") ],
"scope",
[ "brotli.gyp" ])

source_set(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":brotli_config" ]
sources = gypi_values.brotli_sources
if (is_linux) {
defines = [ "OS_LINUX" ]
} else if (is_mac) {
defines = [ "OS_MACOSX" ]
} else if (target_os == "freebsd") {
defines = [ "OS_FREEBSD" ]
template("brotli_gn_build") {
if (node_shared_brotli) {
import("//build/config/linux/pkg_config.gni")
pkg_config("brotli_config") {
packages = [ "libbrotlidec", "libbrotlienc" ]
}
if (is_linux) {
libs = [ "m" ]
group(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":brotli_config" ]
}
if (is_clang || !is_win) {
cflags_c = [
"-Wno-implicit-fallthrough",
"-Wno-unreachable-code",
"-Wno-unreachable-code-return",
]
} else {
config("brotli_config") {
include_dirs = [ "c/include" ]
}

gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("brotli.gyp") ],
"scope",
[ "brotli.gyp" ])

source_set(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":brotli_config" ]
sources = gypi_values.brotli_sources
if (is_linux) {
defines = [ "OS_LINUX" ]
} else if (is_mac) {
defines = [ "OS_MACOSX" ]
} else if (target_os == "freebsd") {
defines = [ "OS_FREEBSD" ]
}
if (is_linux) {
libs = [ "m" ]
}
if (is_clang || !is_win) {
cflags_c = [
"-Wno-implicit-fallthrough",
"-Wno-unreachable-code",
"-Wno-unreachable-code-return",
]
}
}
}
}
135 changes: 74 additions & 61 deletions deps/cares/unofficial.gni
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,91 @@

# The actual configurations are put inside a template in unofficial.gni to
# prevent accidental edits from contributors.
template("cares_gn_build") {
config("cares_config") {
include_dirs = [ "include" ]
if (!is_component_build) {
defines = [ "CARES_STATICLIB" ]
}
}

gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("cares.gyp") ],
"scope",
[ "cares.gyp" ])
import("../../node.gni")

component(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":cares_config" ]
if (is_component_build) {
defines = [ "CARES_BUILDING_LIBRARY" ]
} else {
defines = []
template("cares_gn_build") {
if (node_shared_cares) {
import("//build/config/linux/pkg_config.gni")
pkg_config("cares_config") {
packages = [ "libcares" ]
}
if (is_win) {
defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
group(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":cares_config" ]
}
if (is_posix) {
defines += [
"_DARWIN_USE_64_BIT_INODE=1",
"_LARGEFILE_SOURCE",
"_FILE_OFFSET_BITS=64",
"_GNU_SOURCE",
"HAVE_CONFIG_H",
]
} else {
config("cares_config") {
include_dirs = [ "include" ]
if (!is_component_build) {
defines = [ "CARES_STATICLIB" ]
}
}

include_dirs = [
"src/lib",
"src/lib/include",
]
if (is_win) {
include_dirs += [ "config/win32" ]
} else if (is_linux) {
include_dirs += [ "config/linux" ]
} else if (is_mac) {
include_dirs += [ "config/darwin" ]
}
gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("cares.gyp") ],
"scope",
[ "cares.gyp" ])

if (is_win) {
libs = [
"ws2_32.lib",
"iphlpapi.lib",
]
}
component(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":cares_config" ]
if (is_component_build) {
defines = [ "CARES_BUILDING_LIBRARY" ]
} else {
defines = []
}
if (is_win) {
defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
}
if (is_posix) {
defines += [
"_DARWIN_USE_64_BIT_INODE=1",
"_LARGEFILE_SOURCE",
"_FILE_OFFSET_BITS=64",
"_GNU_SOURCE",
"HAVE_CONFIG_H",
]
}

sources = gypi_values.cares_sources_common
if (is_linux) {
sources += [ "config/linux/ares_config.h" ]
}
if (is_mac) {
sources += gypi_values.cares_sources_mac
}
include_dirs = [
"src/lib",
"src/lib/include",
]
if (is_win) {
include_dirs += [ "config/win32" ]
} else if (is_linux) {
include_dirs += [ "config/linux" ]
} else if (is_mac) {
include_dirs += [ "config/darwin" ]
}

if (is_clang) {
if (is_win) {
cflags_c = [
"-Wno-macro-redefined",
]
} else {
cflags_c = [
"-Wno-implicit-fallthrough",
"-Wno-unreachable-code",
libs = [
"ws2_32.lib",
"iphlpapi.lib",
]
}

sources = gypi_values.cares_sources_common
if (is_linux) {
sources += [ "config/linux/ares_config.h" ]
}
if (is_mac) {
sources += gypi_values.cares_sources_mac
}

if (is_clang) {
if (is_win) {
cflags_c = [
"-Wno-macro-redefined",
]
} else {
cflags_c = [
"-Wno-implicit-fallthrough",
"-Wno-unreachable-code",
]
}
}
}
}
}
53 changes: 33 additions & 20 deletions deps/histogram/unofficial.gni
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,42 @@

# The actual configurations are put inside a template in unofficial.gni to
# prevent accidental edits from contributors.
import("../../node.gni")

template("histogram_gn_build") {
config("histogram_config") {
include_dirs = [ "include" ]
}
if (node_shared_hdr_histogram) {
import("//build/config/linux/pkg_config.gni")
pkg_config("histogram_config") {
packages = [ "hdr_histogram" ]
}
group(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":histogram_config" ]
}
} else {
config("histogram_config") {
include_dirs = [ "include" ]
}

gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("histogram.gyp") ],
"scope",
[ "histogram.gyp" ])
gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("histogram.gyp") ],
"scope",
[ "histogram.gyp" ])

source_set(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":histogram_config" ]
sources = gypi_values.histogram_sources
if (is_clang || !is_win) {
cflags_c = [
"-Wno-atomic-alignment",
"-Wno-incompatible-pointer-types",
"-Wno-unused-function",
]
}
if (is_linux) {
libs = [ "atomic" ]
source_set(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":histogram_config" ]
sources = gypi_values.histogram_sources
if (is_clang || !is_win) {
cflags_c = [
"-Wno-atomic-alignment",
"-Wno-incompatible-pointer-types",
"-Wno-unused-function",
]
}
if (is_linux) {
libs = [ "atomic" ]
}
}
}
}
47 changes: 30 additions & 17 deletions deps/llhttp/unofficial.gni
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,39 @@

# The actual configurations are put inside a template in unofficial.gni to
# prevent accidental edits from contributors.
import("../../node.gni")

template("llhttp_gn_build") {
config("llhttp_config") {
include_dirs = [ "include" ]
}
if (node_shared_http_parser) {
import("//build/config/linux/pkg_config.gni")
pkg_config("llhttp_config") {
packages = [ "libllhttp" ]
}
group(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":llhttp_config" ]
}
} else {
config("llhttp_config") {
include_dirs = [ "include" ]
}

gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("llhttp.gyp") ],
"scope",
[ "llhttp.gyp" ])
gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("llhttp.gyp") ],
"scope",
[ "llhttp.gyp" ])

source_set(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":llhttp_config" ]
include_dirs = [ "include" ]
sources = gypi_values.llhttp_sources
if (is_clang || !is_win) {
cflags_c = [
"-Wno-implicit-fallthrough",
"-Wno-unreachable-code",
]
source_set(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":llhttp_config" ]
include_dirs = [ "include" ]
sources = gypi_values.llhttp_sources
if (is_clang || !is_win) {
cflags_c = [
"-Wno-implicit-fallthrough",
"-Wno-unreachable-code",
]
}
}
}
}
Loading
Loading