diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-10-05 07:06:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 19:36:44 +0530 |
commit | 0b016a7fb8639ce49603c8c339539174b191a4b1 (patch) | |
tree | c511060d701db60ede0214b7280e89c5749bbe62 /cli/build.rs | |
parent | 3a3a8484069c9c6955fcb83ea761f9f74638175a (diff) |
feat(npm): implement Node API (#13633)
This PR implements the NAPI for loading native modules into Deno.
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'cli/build.rs')
-rw-r--r-- | cli/build.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/build.rs b/cli/build.rs index df4cd5917..aaa29a6d0 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -331,6 +331,21 @@ fn main() { if target != host { panic!("Cross compiling with snapshot is not supported."); } + + #[cfg(target_os = "windows")] + println!( + "cargo:rustc-link-arg-bin=deno=/DEF:{}", + std::path::Path::new("exports.def") + .canonicalize() + .expect( + "Missing exports.def! Generate using tools/napi/generate_link_win.js" + ) + .display(), + ); + + #[cfg(not(target_os = "windows"))] + println!("cargo:rustc-link-arg-bin=deno=-rdynamic"); + // To debug snapshot issues uncomment: // op_fetch_asset::trace_serializer(); |