SwiftPMExamples
Examples of Swift Package Manager; C, Cpp and ObjC linking examples
Install / Use
/learn @YutoMizutani/SwiftPMExamplesREADME
SwiftPMExamples
Examples of Swift Package Manager
Use Clang
Simple
Simple (automatically generated) modulemap
Targets
- Simple (Swift) - CHello
- CHello (Clang)
.
├── Sources
│ ├── CHello
│ │ └── include
│ └── Simple
└── Tests
└── SimpleTests
</p>
</details>
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)
.
├── Sources
│ ├── CHello
│ │ ├── include
│ │ └── src
│ ├── Staticlib
│ └── libhello
│ ├── bin
│ ├── example
│ ├── include
│ ├── lib
│ ├── src
│ └── tmp
└── Tests
└── StaticlibTests
</p>
</details>
Use Cpp
CLinkage
Cpp called from extern linkage C header
Targets
- CLinkage (Swift) - CppHello
- CppHello (Cpp)
.
├── Sources
│ ├── CLinkage
│ └── CppHello
│ └── include
└── Tests
└── CLinkageTests
</p>
</details>
Use Objc
Simple
Targets
- Simple (Swift) - ObjcHello
- ObjcHello (Objc)
.
├── Sources
│ ├── ObjcHello
│ │ └── include
│ └── Simple
└── Tests
└── SimpleTests
</p>
</details>
Swift only
GitHubLib
Targets
- GitHubLib (Swift) - PlayingCard
- PlayingCard (Swift) from GitHub - apple/example-package-playingcard
.
├── Sources
│ └── GitHubLib
└── Tests
└── GitHubLibTests
</p>
</details>
MultiLayer
Targets
- MultiLayer (Swift) - FooBar
- FooBar (Swift)
.
├── Sources
│ ├── FooBar
│ │ ├── Sources
│ │ │ ├── Bar
│ │ │ ├── Foo
│ │ │ └── FooBar
│ │ └── Tests
│ │ └── FooBarTests
│ └── MultiLayer
└── Tests
└── MultiLayerTests
</p>
</details>
MultiModule
Targets
- MultiModule (Swift) - Bar, Foo
- Bar (Swift)
- Foo (Swift)
.
├── Sources
│ ├── Bar
│ ├── Foo
│ └── MultiModule
└── Tests
└── MultiModuleTests
</p>
</details>
Simple
Targets
- Simple (Swift)
.
├── Sources
│ └── Simple
└── Tests
└── SimpleTests
</p>
</details>
For Developers
Test
$ make test
Clean
$ make clean
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
