diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/Cargo.toml | 3 | ||||
-rw-r--r-- | core/build.rs | 14 | ||||
-rw-r--r-- | core/libdeno.rs | 28 |
3 files changed, 31 insertions, 14 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml index b96713e19..a922e8837 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -4,6 +4,9 @@ name = "deno" version = "0.3.5" edition = "2018" +description = "A secure JavaScript/TypeScript runtime built with V8, Rust, and Tokio" +authors = ["The deno authors <bertbelder@nodejs.org>"] +license = "MIT" [lib] path = "lib.rs" diff --git a/core/build.rs b/core/build.rs index 8b827d9e7..43e993dc9 100644 --- a/core/build.rs +++ b/core/build.rs @@ -11,20 +11,6 @@ fn main() { "cargo:rustc-link-search=native={}/obj/core/libdeno", build.gn_out_dir ); - if cfg!(target_os = "windows") { - println!("cargo:rustc-link-lib=static=libdeno"); - } else { - println!("cargo:rustc-link-lib=static=deno"); - } - - // Link the system libraries that libdeno and V8 depend on. - if cfg!(any(target_os = "macos", target_os = "freebsd")) { - println!("cargo:rustc-link-lib=dylib=c++"); - } else if cfg!(target_os = "windows") { - for lib in vec!["dbghelp", "shlwapi", "winmm", "ws2_32"] { - println!("cargo:rustc-link-lib={}", lib); - } - } build.run("core:deno_core_deps"); } diff --git a/core/libdeno.rs b/core/libdeno.rs index 72003a372..1a80330de 100644 --- a/core/libdeno.rs +++ b/core/libdeno.rs @@ -133,6 +133,34 @@ pub struct deno_config { pub recv_cb: deno_recv_cb, } +#[cfg(not(windows))] +#[link(name = "deno")] +extern "C" {} + +#[cfg(any(target_os = "macos", target_os = "freebsd"))] +#[link(name = "c++")] +extern "C" {} + +#[cfg(windows)] +#[link(name = "libdeno")] +extern "C" {} + +#[cfg(windows)] +#[link(name = "shlwapi")] +extern "C" {} + +#[cfg(windows)] +#[link(name = "winmm")] +extern "C" {} + +#[cfg(windows)] +#[link(name = "ws2_32")] +extern "C" {} + +#[cfg(windows)] +#[link(name = "dbghelp")] +extern "C" {} + extern "C" { pub fn deno_init(); pub fn deno_v8_version() -> *const c_char; |