kabiroberai / node-swift

Create Node modules in Swift
MIT License
492 stars 16 forks source link

Multiple modules / dynamic libs in the same package #44

Open fpirsch opened 1 month ago

fpirsch commented 1 month ago

I need to build several distinct NodeModules in the same project. I have this directory structure

root
  ├ Sources
  │  ├ Module1
  │  │   └ Module1.swift
  │  └ Module2
  │      └ Module2.swift
  ├ package.json
  └ Package.swift

And in Package.swift I declared my 2 .dynamic products and the 2 associated targets. When I run node-swift build I get this error : Error: Found more than 1 dynamic library in the Swift Package. Consider specifying which product should be built via the swift.product field in package.json.

I ended up patching cli.js to accept another command line argument specifying which product to build.

Is there some other way to achieve this ?