Giter Club home page Giter Club logo

Comments (8)

mcollina avatar mcollina commented on September 1, 2024

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.

sampsongao avatar sampsongao commented on September 1, 2024

Can you post an example of the output binding.gyp?

from node-addon-api.

mcollina avatar mcollina commented on September 1, 2024

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.

mhdawson avatar mhdawson commented on September 1, 2024

@sampsongao have you had a chance to look at this ?

from node-addon-api.

sampsongao avatar sampsongao commented on September 1, 2024

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.

sampsongao avatar sampsongao commented on September 1, 2024

@mcollina can you try #158 to see if it works for your case?

from node-addon-api.

mhdawson avatar mhdawson commented on September 1, 2024

ping @mcollina any chance you can try this out ?

from node-addon-api.

digitalinfinity avatar digitalinfinity commented on September 1, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.