node-libclang
node-libclang copied to clipboard
Regenerate lib/dynamic_clang.js for clang-9
Forked and fixed quite a few more things: https://github.com/node-ffi-packager/node-libclang
Note: includes commits from previous pull-requests. Should be merged to master one by one, but wanted to showcase the stepwise progress and allow for feedback.
- https://github.com/tjfontaine/node-libclang/pull/16
- https://github.com/tjfontaine/node-libclang/pull/17
- Uses
clang-9to regenerate support for itself. - Version 9 is the most recent major version, released 2019-09-19.
- Has additional methods not supported by
clang-6.0(the only other version tested). - Dynamically targeting the right version might be possible, but also requires more effort in generation and tests.
- Cross-generation between versions might be possible.
- Built on Ubuntu 19.10 Eoan using from
node-ffi-generatewith suport for Elaborated types.
ln --symbolic --force "$(which "llvm-config-9")" "${HOME}/bin/llvm-config"
llvm-config --version
LD_LIBRARY_PATH="$(llvm-config --libdir)" node ./lib/generateffi.js
NOTE: move the generated newclang.js to replace lib/dynamic_clang.js.
See
- https://releases.llvm.org/9.0.0/docs/ReleaseNotes.html
- https://en.wikipedia.org/wiki/Clang
- https://github.com/tjfontaine/node-ffi-generate
Adds 200 or so lines of improvements between clang v6.0 and v9. In particular, I needed the new support for size_t to avoid some corruption issues when reading back struct data from a library using generated ref-struct parsing.
Forked and fixed quite a few more things, might help someone: https://github.com/node-ffi-packager/node-libclang