Reduce clutter, speed up compilations, etc. by using (and writing your own!) clang "modules"
Objective-C Ruby
Latest commit 90990f3 Apr 9, 2015 @mralexgray cleaned up structure and made sure everything is working. needs bette…
…r inline documentation, still
Permalink
Failed to load latest commit information.
ModularApp cleaned up structure and made sure everything is working. needs bette… Apr 9, 2015
ModularFramework cleaned up structure and made sure everything is working. needs bette… Apr 9, 2015
ModularSubLibrary cleaned up structure and made sure everything is working. needs bette… Apr 9, 2015
ObjC-Clang-Modules.xcodeproj cleaned up structure and made sure everything is working. needs bette… Apr 9, 2015
SubUmbrella
VariousDocumentation don't remember much about this, but there's a pull request, so i'm go… Apr 9, 2015
.gitignore don't remember much about this, but there's a pull request, so i'm go… Apr 9, 2015
LICENSE don't remember much about this, but there's a pull request, so i'm go… Apr 9, 2015
ModularCLI.m cleaned up structure and made sure everything is working. needs bette… Apr 9, 2015
README.md don't remember much about this, but there's a pull request, so i'm go… Apr 9, 2015

README.md

ObjC-Clang-Modules

Reduce clutter, speed up compilations, etc. by using (and writing your own!) clang "modules"

What used to involve LOTS of moving pieces....

  • Link to a framework via ld, á la.. clang -framework Cocoa main.m -o MyApp
  • Import headers, á la #import <Cocoa/Cocoa.h>
  • Icky precompiled headers, and their littany of woes.

Now (Xcode5, OSX 10.9) is as simple as...

CLANG_ENABLE_MODULES   = YES
CLANG_MODULES_AUTOLINK = YES

aka clang -fmodules ...

@import Cocoa;

No linker flags, nothing, zilcha, nada zero. No muss, no fuss.

  • Get rid of YourProject-Prefix.pch!
  • Delete the Frameworks group from Xcode projects.
  • Purge the Link to Frameworks build phase!
  • Buiild faster, and smile, it's Objc, not Chekov!

BONUS:

Although you'll be hard-pressed to find even a mention of "modules" on Apple's site.. and that

At this time, modules are only available for Apple’s frameworks. and have been implicitly disabled for C++.

...it IS INDEED possible to "write your own modules!". Fork this repo to find out how!

Now you can import YOUR OWN frameworks with a simple.

@import ModularFramework

Genius!