. ├── Package.swift └── Sources ├── App │ └── main.swift ├── ClibB │ ├── Greeting.cpp │ └── include │ └── Greeting.hpp └── ClibBWrapper ├── HelloCpp.mm └── include └── HelloCpp.h
1つのPackage.swiftでやると、 ^ C++のコードをObjC++でラップしたモジュールを使うSwiftのパッケージ構成はこんな感じで、 Package.swiftは // swift-tools-version:4.0 import PackageDescription let package = Package( name: "Hello", targets: [.target(name: "App", dependencies:["ClibBWrapper"]), .target(name: "ClibBWrapper", dependencies:["ClibB"]), .target(name: "ClibB"),] )
こう。
1