Skip to content

cmake.js support #268

Open
Open

Description

@xVanTuring

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.

Activity

  1. xVanTuring commented on Jan 17, 2019

    @xVanTuring
    Author

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

  2. incomingstick commented on Oct 2, 2019

    @incomingstick

    @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

  3. almoghamdani commented on Dec 16, 2019

    @almoghamdani

    Are there any plans on adding this feature?

  4. malept commented on Dec 18, 2019

    @malept
    Member

    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!

  5. smalls12 commented on Jan 30, 2021

    @smalls12

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

  6. smalls12 commented on Jan 31, 2021

    @smalls12

    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.

  7. zhex900 commented on Jun 10, 2021

    @zhex900

    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?

  8. zhex900 commented on Jun 16, 2021

    @zhex900

    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
    
  9. dogeFu commented on Nov 10, 2021

    @dogeFu

    Is cmake-js supported now?

  10. asmbaty commented on Sep 20, 2022

    @asmbaty

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions