Skip to content

windows js_module_loader_so support #486

@zeromake

Description

@zeromake

I've done one before by dlfcn-win32, now use win32 api LoadLibraryW, GetProcAddress, FreeLibrary replace unix dlopen, dlsym, dlclose.

Here's my implementation, ignore xmake build file
zeromake@86b7df5#diff-95fe784bea3e0fbdf30ba834b1a74b538090f4d70f4f8770ef397ef68ec37aa3R482

Run an example

❯ git clone https://github.com/zeromake/quickjs-ng.git
❯ cd quickjs-ng && xmake f -c -y
❯ xmake b qjsc && xmake b qjs && xmake b fib
❯ xmake r qjs ..\..\..\..\examples\test_fib.js
Hello World
fib(10)= 55

But there are still a lot of uncertainties

  1. like node native file is .node be supported, but quickjs is .so.
  2. fallback path search? Eg: "./fib.so" find ["./fib.so", "./fib-${platform}-${arch}.so"]
  3. cmake test windows local native module support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions