Skip to content

Conan gyp generator to handle dependencies for node-gyp

Notifications You must be signed in to change notification settings

czoido/conan-gyp-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Conan gyp generator:

This Conan generator will generate a gyp file with all the dependencies. The original intended use of this generator is to make easier link with third party libraries when adding native modules to node using node-gyp.

It's just a minimal implementation and has only been tested on MacOS and shared libraries.

Find some more detailed information in this blogpost.

To install the generator:

git clone https://github.com/czoido/conan-gyp-generator
cd conan-gyp-generator
conan config install gyp-generator.py -tf generators

Create your consumer project (see docs) with a conanfile.txt like this:

[requires]
yaml-cpp/0.6.3

[generators]
node_gyp

[options]
yaml-cpp:shared=True

A file conanbuildinfo.gyp will be generated, you have to add dependencies via that file in your binding.gyp like this one:

{
    "targets": [{
        "target_name": "conan_node_module",
        "sources": ["main.cpp"],
        "dependencies": ["<(module_root_dir)/conan_build/conanbuildinfo.gyp:yaml-cpp"],
        "conditions": [[
            "OS=='mac'", {
                "xcode_settings": {
                    "GCC_ENABLE_CPP_EXCEPTIONS": "YES"
                }
            }
        ]]
    }]
}

About

Conan gyp generator to handle dependencies for node-gyp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages