Is there wildcard mechanism for listing sources in node-gyp

前端 未结 4 1429
日久生厌
日久生厌 2021-02-05 12:41

I\'m writing binding.gyp file for my new node.js module. I have all my source files under src/ subdirectory. I would like to use all of them while buil

4条回答
  •  天涯浪人
    2021-02-05 13:07

    To filter specific file extensions like cpp and to support also pre-compiled libraries .a files, I have slightly modified the accepted solution to be:

    'sources': [
            'jamspell.cpp',
            "f.endsWith('.cpp')).map(f=>'src/'+f).join(' ')\")",
            "f.endsWith('.cpp')).map(f=>'src/jamspell/'+f).join(' ')\")"
            ],
            'include_dirs': [
                "f.endsWith('.a')).map(f=>'lib/contrib/'+f).join(' ')\")"
            ],
            'dependencies': [
                "

提交回复
热议问题