I'm trying to add swift support to an existing Objective-C based framework and I'm running into compilation errors when integrating the framework into the app (the framework alone builds fine).
My goal is to be able to access from swift, Objective-C project headers and to achieve this I've been using a modulemap file to list all the project files as indicated for example here: http://nsomar.com/project-and-private-headers-in-a-swift-and-objective-c-framework/
My directory structure is as follow:
MyFramework
Folder1
baz.h
baz.m
Folder2
bar.h
bar.m
foo.h
foo.m
SwiftClass.swift
MyFramework.h
module.modulemap
The module.modulemap file looks like this:
module MyFramework_Internal {
header "Folder1/Baz.h"
header "Folder1/Folder2/Bar.h"
export *
}
foo is public, bar and baz have project membership instead. If bar.h includes foo (e.g. #import "Foo.h"), building the app fails with the following error:
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "Folder1/Folder2/Bar.h"
^
.../Folder1/Folder2/Bar.h:10:9: error: 'Baz.h' file not found
#import "Baz.h"
^
<unknown>:0: error: could not build Objective-C module 'MyFramework_Internal'
Any idea of what I'm doing wrong? Because I'm not sure why importing that public header is causing this sort of error.