Search code examples
swiftswift-package-manager

Swift Module map header path


I'm trying to import a C module into a Swift target based on this blog post, however I'm having a hard time creating the .modulemap file.

My folder structure is:

include/header.h
module.modulemap

My module.modulemap looks like this:

framework module Module {
    umbrella header "include/header.h"
}

However, when I try to compile the project, it can't find the umbrella header. The only way it works is if it I put an absolute path, but that won't work for obvious reasons.


Where exactly is the base path that I'm supposed to have my include relative to?


Solution

  • As a first workaround, I decided to stop f**king around with the path in the .modulemap file, moved it right next to the header file and changed the spec.module_map in .podspec to point a folder deeper.