I created a Swift 5.1 app with Xcode 11.0 which contains c-files and h-files. A bridging header was automatically generated by Xcode. I entered the necessary #imports. The project compiles and runs as expected. Now I wanted to create a Swift-package which contains the c-files and header-files, the bridging-header file and a Swift file which is a wrapper of the c-functions. I did it in the following way.
- I opened file->new->Swift Package
- I filled out the name field of the package and the add to: and group: fields
- Now the Package.swift appeared in the project.
- I moved the Swift files, from the project folder into the Package.swift/Sources/packageName folder.
- Just for test reasons I changed to the target/General window and pressed the + Button of Frameworks, Library and embedded Content.
- In the appearing List of frameworks I could find the name of my package, as expected.
- I canceled the window and went back to move a single c-file into the package folder.
- Then I went back to the target/General window and pressed the + Button again and now surprisingly the list doesn't contain my package name
It seems to me, that including c-files into a Swift-package requires some additional steps. I searched in the documentation, but I couldn't find a hint.