Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Distributing cmake options in npm packages

See original GitHub issue

I’m maintaining the nbind project which autogenerates NAN and Emscripten bindings (and TypeScript definitions) for C++ classes and functions. It makes writing Node.js addons extremely easy but requires a number of compiler options to use especially when targeting Emscripten, so it comes with a couple of .gypi files.

Another tool, autogypi autogenerates a binding.gyp file for a new project given names of packages it depends on. It plays nicely with both nbind and nan, noticing the former depends on the latter and sets everything up.

I’d like to add support for cmake-js in nbind and autogypi, so that these quick start instructions would be equally easy when using cmake-js instead of node-gyp (this would be an option). That would also get rid of the Python 2 dependency (unless targeting Emscripten, which still depends on it).

For this, maybe some sort of interaction between cmake-js and autogypi would be useful? Do you have any thoughts for a standard way to include the necessary CMakeLists options in npm packages intended to be used as C++ libraries?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

ed-alertedhcommented, Jul 9, 2018

Did anything ever come of this? I’m currently trying to port an existing lib built with CMake and being able to use the build files almost as-is would be amazing…

edit: I’m currently trying to use nbind to target asm.js for in-browser usage

Julusiancommented, May 9, 2022

It sounds like this was answered, and as nbind appears abandoned I dont see anything here that needs doing

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmake-js - npm
You can set npm configuration options for CMake.js. ... CMake.js will set a variable named "<key>" to <value> (by using -D<key>="<value>" option).
Read more >
node.js - Inconsistent behavior while installing npm module
I am installing a npm module which use cmake-js inside it. (I mentioned cmake-js just for the information). I am behind a corporate...
Read more >
CMake Tutorial — CMake 3.16.9 Documentation
The CMake tutorial provides a step-by-step guide that covers common build system issues that CMake helps address. Seeing how various topics all work ......
Read more >
Catkin and Packages
Thus, each package has a CMakeLists.txt file that is used by cmake to ... The install space can be used to create and...
Read more >
Chapter 4, MySQL Source-Configuration Options
Formats Description Default BUILD_CONFIG Use same build options as official releases CMAKE_BUILD_TYPE Type of build to produce RelWithDebInfo CMAKE_CXX_FLAGS Flags for C++ Compiler
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found