Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake.js support #268

Open
xVanTuring opened this issue Jan 17, 2019 · 10 comments
Open

cmake.js support #268

xVanTuring opened this issue Jan 17, 2019 · 10 comments

Comments

@xVanTuring
Copy link

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.

@xVanTuring
Copy link
Author

Well, Simply add an empty binding.gyp will work .
Official support will be awesome. Should I Leave it open?

@incomingstick
Copy link

@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

@almoghamdani
Copy link

Are there any plans on adding this feature?

@malept
Copy link
Member

malept commented Dec 18, 2019

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!

@smalls12
Copy link

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 :(

@smalls12
Copy link

Found the problem between node-gyp and cmake-js
node-gyp is patching extra definitions behind the scenes
cmake-js/cmake-js#222 (comment)

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.

@zhex900
Copy link

zhex900 commented Jun 10, 2021

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?

@zhex900
Copy link

zhex900 commented Jun 16, 2021

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

@dogeFu
Copy link

dogeFu commented Nov 10, 2021

Is cmake-js supported now?

@asmbaty
Copy link

asmbaty commented Sep 20, 2022

Is there a final workaround for how to use cmake-js with electron-rebuild or how to avoid it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants