I have a project that is mostly Swift, but has some (internal) Objective-C code wrapping around CommonCrypto functions. It took some some tinkering, but we managed to make it work without exposing the internals by making all the headers private and using a bridging header, not added to any target but referenced in build setting "Objective-C Bridging Header" (on the targets, not the project).
Now we decided to move this part of the project into its own framework. So I created a new project (as Cocoa Touch Framework, same as the old), copied over the necessary source files, recreated the bridging header, and expected it to compile.
However, I'm getting
error: using bridging headers with framework targets is unsupported
This is confusing since there is one in the other project, which builds just fine (for iOS and macOS).
I went through all of the build settings, project and target. The only differences are
- iOS target version 10.3 (new) vs 10.2 (old),
- no signing vs signing (that may just be because the new project never built), and
- some static analysis setting about suspicious conversions.
Neither of those should impact this matter. Nevertheless, I confirmed that the new project doesn't build for 10.2, either.
So what's going on here?