mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
Make 'tokio' build on windows, add windows deps
This commit is contained in:
parent
4b75dd7cf5
commit
d8cc487a46
3 changed files with 119 additions and 14 deletions
17
BUILD.gn
17
BUILD.gn
|
@ -60,10 +60,12 @@ main_extern = [
|
||||||
"$rust_build:futures",
|
"$rust_build:futures",
|
||||||
"$rust_build:idna",
|
"$rust_build:idna",
|
||||||
"$rust_build:iovec",
|
"$rust_build:iovec",
|
||||||
|
"$rust_build:kernel32",
|
||||||
"$rust_build:lazy_static",
|
"$rust_build:lazy_static",
|
||||||
"$rust_build:lazycell",
|
"$rust_build:lazycell",
|
||||||
"$rust_build:memoffset",
|
"$rust_build:memoffset",
|
||||||
"$rust_build:mio",
|
"$rust_build:mio",
|
||||||
|
"$rust_build:miow",
|
||||||
"$rust_build:net2",
|
"$rust_build:net2",
|
||||||
"$rust_build:nodrop",
|
"$rust_build:nodrop",
|
||||||
"$rust_build:num_cpus",
|
"$rust_build:num_cpus",
|
||||||
|
@ -85,11 +87,24 @@ main_extern = [
|
||||||
"$rust_build:unicode_bidi",
|
"$rust_build:unicode_bidi",
|
||||||
"$rust_build:unicode_normalization",
|
"$rust_build:unicode_normalization",
|
||||||
"$rust_build:winapi",
|
"$rust_build:winapi",
|
||||||
|
"$rust_build:ws2_32",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Old version of the 'winapi' crate, required by 'mio', 'miow', and 'iovec'.
|
||||||
|
# This exceptional! Generally we don't allow multiple versions of a crate.
|
||||||
|
# TODO: Remove this dependency. https://github.com/denoland/deno/issues/484
|
||||||
|
main_extern_version = [
|
||||||
|
{
|
||||||
|
label = "$rust_build:winapi-0.2"
|
||||||
|
crate_name = "winapi"
|
||||||
|
crate_version = "0.2"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
rust_executable("deno") {
|
rust_executable("deno") {
|
||||||
source_root = "src/main.rs"
|
source_root = "src/main.rs"
|
||||||
extern = main_extern
|
extern = main_extern
|
||||||
|
extern_version = main_extern_version
|
||||||
deps = [
|
deps = [
|
||||||
":libdeno",
|
":libdeno",
|
||||||
]
|
]
|
||||||
|
@ -102,6 +117,7 @@ rust_executable("deno") {
|
||||||
rust_executable("deno_ns") {
|
rust_executable("deno_ns") {
|
||||||
source_root = "src/main.rs"
|
source_root = "src/main.rs"
|
||||||
extern = main_extern
|
extern = main_extern
|
||||||
|
extern_version = main_extern_version
|
||||||
deps = [
|
deps = [
|
||||||
":libdeno_nosnapshot",
|
":libdeno_nosnapshot",
|
||||||
]
|
]
|
||||||
|
@ -110,6 +126,7 @@ rust_executable("deno_ns") {
|
||||||
rust_test("test_rs") {
|
rust_test("test_rs") {
|
||||||
source_root = "src/main.rs"
|
source_root = "src/main.rs"
|
||||||
extern = main_extern
|
extern = main_extern
|
||||||
|
extern_version = main_extern_version
|
||||||
deps = [
|
deps = [
|
||||||
":libdeno",
|
":libdeno",
|
||||||
]
|
]
|
||||||
|
|
|
@ -83,17 +83,15 @@ rust_component("tempfile") {
|
||||||
|
|
||||||
rust_component("rand") {
|
rust_component("rand") {
|
||||||
source_root = "$registry_github/rand-0.5.4/src/lib.rs"
|
source_root = "$registry_github/rand-0.5.4/src/lib.rs"
|
||||||
extern = [
|
|
||||||
":libc",
|
|
||||||
":rand_core",
|
|
||||||
]
|
|
||||||
if (is_win) {
|
|
||||||
extern += [ ":winapi" ]
|
|
||||||
}
|
|
||||||
features = [
|
features = [
|
||||||
"std",
|
"std",
|
||||||
"alloc",
|
"alloc",
|
||||||
]
|
]
|
||||||
|
extern = [
|
||||||
|
":libc",
|
||||||
|
":rand_core",
|
||||||
|
":winapi",
|
||||||
|
]
|
||||||
if (is_mac) {
|
if (is_mac) {
|
||||||
libs = [ "Security.framework" ]
|
libs = [ "Security.framework" ]
|
||||||
}
|
}
|
||||||
|
@ -105,10 +103,7 @@ rust_component("rand_core") {
|
||||||
|
|
||||||
rust_component("remove_dir_all") {
|
rust_component("remove_dir_all") {
|
||||||
source_root = "$registry_github/remove_dir_all-0.5.1/src/lib.rs"
|
source_root = "$registry_github/remove_dir_all-0.5.1/src/lib.rs"
|
||||||
extern = []
|
extern = [ ":winapi" ]
|
||||||
if (is_win) {
|
|
||||||
extern += [ ":winapi" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rust_component("winapi") {
|
rust_component("winapi") {
|
||||||
|
@ -122,16 +117,21 @@ rust_component("winapi") {
|
||||||
"fileapi",
|
"fileapi",
|
||||||
"guiddef",
|
"guiddef",
|
||||||
"handleapi",
|
"handleapi",
|
||||||
|
"inaddr",
|
||||||
|
"in6addr",
|
||||||
"ktmtypes",
|
"ktmtypes",
|
||||||
"libloaderapi",
|
"libloaderapi",
|
||||||
"lsalookup",
|
"lsalookup",
|
||||||
"minwinbase",
|
"minwinbase",
|
||||||
"minwindef",
|
"minwindef",
|
||||||
|
"mstcpip",
|
||||||
"ntdef",
|
"ntdef",
|
||||||
"ntsecapi",
|
"ntsecapi",
|
||||||
"ntstatus",
|
"ntstatus",
|
||||||
"processthreadsapi",
|
"processthreadsapi",
|
||||||
"profileapi",
|
"profileapi",
|
||||||
|
"qos",
|
||||||
|
"rpcndr",
|
||||||
"sspi",
|
"sspi",
|
||||||
"std",
|
"std",
|
||||||
"subauth",
|
"subauth",
|
||||||
|
@ -143,6 +143,45 @@ rust_component("winapi") {
|
||||||
"winerror",
|
"winerror",
|
||||||
"winnt",
|
"winnt",
|
||||||
"winreg",
|
"winreg",
|
||||||
|
"winsock2",
|
||||||
|
"ws2def",
|
||||||
|
"ws2ipdef",
|
||||||
|
"ws2tcpip",
|
||||||
|
"wtypes",
|
||||||
|
"wtypesbase",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Old version of the 'winapi' crate, required by 'mio', 'miow', and 'iovec'.
|
||||||
|
# This exceptional! Generally we don't allow multiple versions of a crate.
|
||||||
|
# TODO: Remove this dependency. https://github.com/denoland/deno/issues/484
|
||||||
|
rust_component("winapi-0.2") {
|
||||||
|
crate_name = "winapi"
|
||||||
|
crate_version = "0.2"
|
||||||
|
source_root = "$registry_github/winapi-0.2.8/src/lib.rs"
|
||||||
|
}
|
||||||
|
|
||||||
|
# TODO: Remove this crate together with crate 'winapi-0.2'.
|
||||||
|
rust_component("kernel32") {
|
||||||
|
source_root = "$registry_github/kernel32-sys-0.2.2/src/lib.rs"
|
||||||
|
extern_version = [
|
||||||
|
{
|
||||||
|
label = ":winapi-0.2"
|
||||||
|
crate_name = "winapi"
|
||||||
|
crate_version = "0.2"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# TODO: Remove this crate together with crate 'winapi-0.2'.
|
||||||
|
rust_component("ws2_32") {
|
||||||
|
source_root = "$registry_github/ws2_32-sys-0.2.1/src/lib.rs"
|
||||||
|
extern_version = [
|
||||||
|
{
|
||||||
|
label = ":winapi-0.2"
|
||||||
|
crate_name = "winapi"
|
||||||
|
crate_version = "0.2"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,20 +195,64 @@ rust_component("futures") {
|
||||||
|
|
||||||
rust_component("mio") {
|
rust_component("mio") {
|
||||||
source_root = "$registry_github/mio-0.6.15/src/lib.rs"
|
source_root = "$registry_github/mio-0.6.15/src/lib.rs"
|
||||||
|
features = [
|
||||||
|
"default",
|
||||||
|
"with-deprecated",
|
||||||
|
]
|
||||||
extern = [
|
extern = [
|
||||||
":iovec",
|
":iovec",
|
||||||
|
":kernel32",
|
||||||
":lazycell",
|
":lazycell",
|
||||||
|
":libc",
|
||||||
":log",
|
":log",
|
||||||
|
":miow",
|
||||||
":net2",
|
":net2",
|
||||||
":slab",
|
":slab",
|
||||||
":libc",
|
|
||||||
]
|
]
|
||||||
cfg = [ "feature=\"with-deprecated\"" ]
|
|
||||||
|
# TODO: Upgrade to a current version of the 'winapi' crate.
|
||||||
|
# See https://github.com/denoland/deno/issues/484.
|
||||||
|
extern_version = [
|
||||||
|
{
|
||||||
|
label = ":winapi-0.2"
|
||||||
|
crate_name = "winapi"
|
||||||
|
crate_version = "0.2"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
rust_component("miow") {
|
||||||
|
source_root = "$registry_github/miow-0.2.1/src/lib.rs"
|
||||||
|
extern = [
|
||||||
|
":kernel32",
|
||||||
|
":net2",
|
||||||
|
":ws2_32",
|
||||||
|
]
|
||||||
|
|
||||||
|
# TODO: Upgrade to a current version of the 'winapi' crate.
|
||||||
|
# See https://github.com/denoland/deno/issues/484.
|
||||||
|
extern_version = [
|
||||||
|
{
|
||||||
|
label = ":winapi-0.2"
|
||||||
|
crate_name = "winapi"
|
||||||
|
crate_version = "0.2"
|
||||||
|
},
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
rust_component("iovec") {
|
rust_component("iovec") {
|
||||||
source_root = "$registry_github/iovec-0.1.2/src/lib.rs"
|
source_root = "$registry_github/iovec-0.1.2/src/lib.rs"
|
||||||
extern = [ ":libc" ]
|
extern = [ ":libc" ]
|
||||||
|
|
||||||
|
# TODO: Upgrade to a current version of the 'winapi' crate.
|
||||||
|
# See https://github.com/denoland/deno/issues/484.
|
||||||
|
extern_version = [
|
||||||
|
{
|
||||||
|
label = ":winapi-0.2"
|
||||||
|
crate_name = "winapi"
|
||||||
|
crate_version = "0.2"
|
||||||
|
},
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
rust_component("lazycell") {
|
rust_component("lazycell") {
|
||||||
|
@ -178,9 +261,14 @@ rust_component("lazycell") {
|
||||||
|
|
||||||
rust_component("net2") {
|
rust_component("net2") {
|
||||||
source_root = "$registry_github/net2-0.2.33/src/lib.rs"
|
source_root = "$registry_github/net2-0.2.33/src/lib.rs"
|
||||||
|
features = [
|
||||||
|
"default",
|
||||||
|
"duration",
|
||||||
|
]
|
||||||
extern = [
|
extern = [
|
||||||
":cfg_if",
|
":cfg_if",
|
||||||
":libc",
|
":libc",
|
||||||
|
":winapi",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5e912f7b808e3bb1cef7310d0412fdcb79b08fe7
|
Subproject commit 785db4ec088750adde4f63211120ecb828fca148
|
Loading…
Add table
Reference in a new issue