It revealed
{ 'targets' : [ { 'target_name' : 'mymod', 'sources' : [ '< !@ (ls -1 src/*.cpp)' ], } ] }
Mark this link
Update
The solution above is not portable across platforms. Here is the portable version:
{ 'targets' : [ { 'target_name' : 'mymod', 'sources' : [ "< !@ (node -p \"require('fs').readdirSync('./src').map(f=>'src/'+f).join(' ')\")" ], } ] }
Essentially, it replaces the platform specific directory listing ( ls ) ls with Javascript code, which uses the node fs module to display the contents of the directory.
Jayesh
source share