How to create an SPM package based on ObjC code?

Viewed 1053

I'd like to create a SwiftPackageManager library based on Objective-C code but I can't seem to grasp what I'm missing.

My latest change to just vanilla ObjC interface .h file inside the include folder was to add an extra C header that includes de ObjC but still had no success. What am I missing?

enter image description here

The Package.swift file is the default generated one and from what I read it should automatically generate the module map from the include folder.

My swift-tools-version is 5.5

1 Answers

Figured it out. I added a modulemap that specifies my ObjC header and it worked

enter image description here

Not sure if it is the correct way to do it since the include folder should already do this automatically.

Related