Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of @import #377

Open
SpaceTrucker2196 opened this issue Mar 23, 2016 · 2 comments
Open

Use of @import #377

SpaceTrucker2196 opened this issue Mar 23, 2016 · 2 comments

Comments

@SpaceTrucker2196
Copy link

I mentioned this awhile ago and found a work around, but more and more frameworks appear to be using @import which fails with "Use of @import when modules are disabled." the failing library was imported with cocoapods and I looked at the targets and made sure the setting "Allow Non-modular includes in Framework Modules" was set to yes. When building my project normally the build is successful. It's only my cedar specs target thats failing.

How can I test classes that use or have dependancies that use @import?

@briancroom
Copy link
Contributor

Hey @jkunzelman, the @import feature requires clang modules to be enabled. Clang modules are not well-supported for C++, so they are disabled by default, however it is possible to explicitly turn them on, which may or may not resolve your issues. To turn this on, add -fcxx-modules to the Other C++ Flags build settings in your spec target.

There's a real chance you will run into compiler bugs when doing this, but I have seen this work successfully in some basic smoke testing.

@tjarratt
Copy link
Contributor

tjarratt commented Apr 5, 2016

Is there a radar that we could duplicate so that apple is aware that people want to use @import from a C++ context?

Another alternative, albeit less exciting answer, is to switch to using Quick and Nimble, which are available for both Objective-C and Swift. It probably won't be easy, and it's not a magic bullet, because you'll still have some strange cases where things fail to compile for one reason or another, but it certainly would resolve your pain with @import, @jkunzelman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants