Is there wildcard mechanism for listing sources in node-gyp

前端 未结 4 1432
日久生厌
日久生厌 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 12:49

    Figured it out

    {
      'targets' : [
          {
              'target_name' : 'mymod',
              'sources' : [ '

    Check out this link

    Update

    The solution above is not portable across platforms. Here's a portable version:

    {
      'targets' : [
          {
              'target_name' : 'mymod',
              'sources' : [  "'src/'+f).join(' ')\")" ],
          }
       ]
    }
    

    Essentially it replaces the platform specific directory listing command (ls), by Javascript code that uses node's fs module to list the directory contents.

提交回复
热议问题