rebuild
rebuild copied to clipboard
cmake.js support
CMake.js is quite awesome and easy to use. Even used in Microsoft/napajs!
It will be greate to add support for cmake.js.
Currently electron-rebuild can only recognize the binding.gyp
file, I think it should be quite easy to add support for cmake.js.
Well, Simply add an empty binding.gyp will work . Official support will be awesome. Should I Leave it open?
@xVanTuring thank you for the slight work around. When I make your suggested change, it does build via cmake, but not at the correct Node Module Version on my end. Do you have any suggestions?
I would also appreciate official support for cmake-js
Are there any plans on adding this feature?
This is on my TODO list, but it's pretty far down. We'd be happy to have a contribution to add support for this from the community, though!
Any update on this?
I have a native module that when built with cmake-js it works fine. When it builds with node-gyp it behaves differently.
Obviously that is just an issue on my end, but if electron-rebuild could use cmake-js it would solve my problem lol
I tried the blank binding.gyp trick noted above, but electron-rebuild then says it can't parse the file :(
Found the problem between node-gyp and cmake-js node-gyp is patching extra definitions behind the scenes https://github.com/cmake-js/cmake-js/issues/222#issuecomment-732746074
Adding them into my cmake-js then everything works and I can run my native module in electron compiling my module outside of electron-rebuild and then just bringing it in manually.
Figured I would close the loop on this; other people might come here with issues.
I am trying to rebuild aws-crt so it will work with electron.
@xVanTuring said adding an empty binding.gyp
will work. Where do I add this file?
@smalls12 what exactly did you do to make your native module work?
An empty binding.gyp
does not work for me. By adding binding.gyp
to aws-crt
I get these errors:
gyp info spawn C:\Users\jake\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Code\\mir-kiosk-electron\\electron-kiosk\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Code\\mir-kiosk-electron\\electron-kiosk\\node_modules\\aws-crt\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Code\\mir-kiosk-electron\\electron-kiosk\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\jake\\.electron-gyp\\13.1.0\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\jake\\.electron-gyp\\13.1.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Code\\mir-kiosk-electron\\electron-kiosk\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\jake\\\\.electron-gyp\\\\13.1.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Code\\mir-kiosk-electron\\electron-kiosk\\node_modules\\aws-crt',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\Code\\mir-kiosk-electron\\electron-kiosk\\node_modules\\aws-crt\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
\ Preparing native dependencies: 0 / 1gyp: Unable to find targets in build file binding.gyp while trying to load binding.gyp
× Preparing native dependencies: 0 / 1
Is cmake-js supported now?
Is there a final workaround for how to use cmake-js
with electron-rebuild
or how to avoid it?