SkillAgentSearch skills...

SwiftPMExamples

Examples of Swift Package Manager; C, Cpp and ObjC linking examples

Install / Use

/learn @YutoMizutani/SwiftPMExamples
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SwiftPMExamples

Examples of Swift Package Manager

Use Clang

Simple

Simple (automatically generated) modulemap

Targets

  • Simple (Swift) - CHello
  • CHello (Clang)
<details><summary>tree</summary> <p>
.
├── 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)
<details><summary>tree</summary> <p>
.
├── 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)
<details><summary>tree</summary> <p>
.
├── Sources
│   ├── CLinkage
│   └── CppHello
│       └── include
└── Tests
    └── CLinkageTests
</p> </details>

Use Objc

Simple

Targets

  • Simple (Swift) - ObjcHello
  • ObjcHello (Objc)
<details><summary>tree</summary> <p>
.
├── Sources
│   ├── ObjcHello
│   │   └── include
│   └── Simple
└── Tests
    └── SimpleTests
</p> </details>

Swift only

GitHubLib

Targets

<details><summary>tree</summary> <p>
.
├── Sources
│   └── GitHubLib
└── Tests
    └── GitHubLibTests
</p> </details>

MultiLayer

Targets

  • MultiLayer (Swift) - FooBar
  • FooBar (Swift)
<details><summary>tree</summary> <p>
.
├── Sources
│   ├── FooBar
│   │   ├── Sources
│   │   │   ├── Bar
│   │   │   ├── Foo
│   │   │   └── FooBar
│   │   └── Tests
│   │       └── FooBarTests
│   └── MultiLayer
└── Tests
    └── MultiLayerTests
</p> </details>

MultiModule

Targets

  • MultiModule (Swift) - Bar, Foo
  • Bar (Swift)
  • Foo (Swift)
<details><summary>tree</summary> <p>
.
├── Sources
│   ├── Bar
│   ├── Foo
│   └── MultiModule
└── Tests
    └── MultiModuleTests
</p> </details>

Simple

Targets

  • Simple (Swift)
<details><summary>tree</summary> <p>
.
├── Sources
│   └── Simple
└── Tests
    └── SimpleTests
</p> </details>

For Developers

Test

$ make test

Clean

$ make clean

Related Skills

View on GitHub
GitHub Stars7
CategoryDevelopment
Updated5y ago
Forks1

Languages

Swift

Security Score

60/100

Audited on Feb 11, 2021

No findings