Comments (8)
I'm trying to see how do add this. Is it fine if I parse binding.gyp
? I need to add this module within the dependencies add a define for NAPI_CPP_EXCEPTIONS
.
from node-addon-api.
Can you post an example of the output binding.gyp?
from node-addon-api.
Here it is:
{
"targets": [
{
"target_name": "native-hdr-histogram",
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"sources": [
"src/hdr_encoding.h",
"src/hdr_encoding.c",
"src/hdr_histogram.h",
"src/hdr_histogram.c",
"src/hdr_histogram_log.h",
"src/hdr_histogram_log.c",
"hdr_histogram_wrap.cc",
"histogram.cc"
],
"dependencies": [
"<(module_root_dir)/zlib/zlib.gyp:zlib"
],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")",
"src/"
]
}
]
}
What it's missing is the line in dependencies
, like so:
{
"targets": [
{
"target_name": "native-hdr-histogram",
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"sources": [
"src/hdr_encoding.h",
"src/hdr_encoding.c",
"src/hdr_histogram.h",
"src/hdr_histogram.c",
"src/hdr_histogram_log.h",
"src/hdr_histogram_log.c",
"hdr_histogram_wrap.cc",
"histogram.cc"
],
"dependencies": [
"<(module_root_dir)/zlib/zlib.gyp:zlib",
"<!(node -p \"require('node-addon-api').gyp\")"
],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")",
"src/"
]
}
]
}
from node-addon-api.
@sampsongao have you had a chance to look at this ?
from node-addon-api.
So currently the script find a <!(node -p "require('nan')") and replace it with node -p "require('node-addon-api').include"). Maybe we can do find the "dependencies" key and insert the include for node-addon-api and remove nan's if found.
from node-addon-api.
@mcollina can you try #158 to see if it works for your case?
from node-addon-api.
ping @mcollina any chance you can try this out ?
from node-addon-api.
@mcollina we believe this issue should have been resolved with #158- please reopen or file another issue if you still have problems here
from node-addon-api.
Related Issues (20)
- idea: detect JS calls at compile time HOT 4
- Instantiation of ObjectWrap in c++ code causes crash HOT 3
- Just a simple question. HOT 2
- Enabling C++ exceptions on Windows is hell HOT 2
- New SemVer Major release? HOT 4
- Getting sigsegv when passing functions as parameters and building on M1 HOT 4
- Are native addons affected by Node's max memory size constraint? HOT 2
- Running single AsyncWorker at a time HOT 3
- <doc/setup.md> seems outdated HOT 1
- Query on reading/writing js typed arrays from C module. HOT 2
- Request a c++ call js demo. HOT 3
- How to properly handle `Object/Buffer/Uint8Array` in `AsyncWorker`? HOT 9
- How about add C++20 coroutine support to `Napi::Value`? HOT 9
- Node throws exception in main thread (?) when trying to execute event via ThreadSafeFunction HOT 2
- Throwing an object as an exception? HOT 3
- Napi::Value is not properly initialized the first time a program is run HOT 22
- Strange behavior HOT 2
- How do I initialize a variable of type napi_value to NULL to avoid compiler warnings HOT 4
- Failures with VS2022 HOT 4
- Added 22 to test matrixes/deprecate EOL Node.js versions. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-addon-api.