项目作者: YutoMizutani

项目描述 :
Examples of Swift Package Manager; C, Cpp and ObjC linking examples
高级语言: Swift
项目地址: git://github.com/YutoMizutani/SwiftPMExamples.git
创建时间: 2019-08-12T08:22:30Z
项目社区:https://github.com/YutoMizutani/SwiftPMExamples

开源协议:

下载


SwiftPMExamples

Examples of Swift Package Manager

Use Clang

Simple

Simple (automatically generated) modulemap

Targets

  • Simple (Swift) - CHello
  • CHello (Clang)
tree



. ├── Sources │ ├── CHello │ │ └── include │ └── Simple └── Tests └── SimpleTests


Staticlib

One of Clang package (CHello) linked another C static library (libhello/lib/libhello.a)

Targets

  • Staticlib (Swift) - CHello
  • CHello (Clang) - libhello (libhello.a)
  • libhello (Clang)
tree



. ├── Sources │ ├── CHello │ │ ├── include │ │ └── src │ ├── Staticlib │ └── libhello │ ├── bin │ ├── example │ ├── include │ ├── lib │ ├── src │ └── tmp └── Tests └── StaticlibTests


Use Cpp

CLinkage

Cpp called from extern linkage C header

Targets

  • CLinkage (Swift) - CppHello
  • CppHello (Cpp)
tree



. ├── Sources │ ├── CLinkage │ └── CppHello │ └── include └── Tests └── CLinkageTests


Use Objc

Simple

Targets

  • Simple (Swift) - ObjcHello
  • ObjcHello (Objc)
tree



. ├── Sources │ ├── ObjcHello │ │ └── include │ └── Simple └── Tests └── SimpleTests


Swift only

GitHubLib

Targets

tree



. ├── Sources │ └── GitHubLib └── Tests └── GitHubLibTests


MultiLayer

Targets

  • MultiLayer (Swift) - FooBar
  • FooBar (Swift)
tree



. ├── Sources │ ├── FooBar │ │ ├── Sources │ │ │ ├── Bar │ │ │ ├── Foo │ │ │ └── FooBar │ │ └── Tests │ │ └── FooBarTests │ └── MultiLayer └── Tests └── MultiLayerTests


MultiModule

Targets

  • MultiModule (Swift) - Bar, Foo
  • Bar (Swift)
  • Foo (Swift)
tree



. ├── Sources │ ├── Bar │ ├── Foo │ └── MultiModule └── Tests └── MultiModuleTests


Simple

Targets

  • Simple (Swift)
tree



. ├── Sources │ └── Simple └── Tests └── SimpleTests


For Developers

Test

  1. $ make test

Clean

  1. $ make clean