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

Add sqlite3.h to Xcode project #163

Closed
davedelong opened this issue Jul 29, 2015 · 4 comments
Closed

Add sqlite3.h to Xcode project #163

davedelong opened this issue Jul 29, 2015 · 4 comments

Comments

@davedelong
Copy link
Contributor

Instead of manually defining the path to sqlite3.h in module.modulemap, you should instead add the file directly to the xcodeproj.

Add it by finding it within your current SDK (i.e., Xcode.app/Contents/Developer/Platforms/{platform}.platform/Developer/SDKs/{SDK}.sdk/usr/include/sqlite3.h). When you add it this way, Xcode notices that it's relative to your current SDK, and so it gets added to the .xcodeproj as a relative file, like this:

55C030C21B691CB40051264D /* sqlite3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sqlite3.h; path = usr/include/sqlite3.h; sourceTree = SDKROOT; };

Since the "sourceTree" of the file is "SDKROOT", it will correctly resolve to either the Mac SDK or the iOS SDK, depending on what your build destination is. Then you can delete the manual path specification in module.modulemap, and it should all Just Work™.

@stephencelis
Copy link
Owner

@davedelong Hm, this was one of the first things I tried and compilation failed. I'll try again tonight and see if I can get it to work. Otherwise I'll file a radar.

@stephencelis
Copy link
Owner

Got it working! Must have bungled it the first time around. Just need to confirm/push master with my non-Capitan machine. Thanks!

@stephencelis
Copy link
Owner

This is "fixed" in the swift-2 branch, though CocoaPods must still use a custom module map as it cannot currently generate project files with SDKROOT-relative files: CocoaPods/CocoaPods#3942

@rickpasetto
Copy link

Greetings. Looks like still having the module.modulemap files still hard-coding the location of sqlite3.h causes dependent projects to fail to build if they don't have Xcode.app installed in /Applications (for instance, if they have Xcode Beta.app or multiple versions of Xcode installed). Commenting out the "header" lines in the module.modulemaps works around the problem, but can you fix this for those of us who do not use CocoaPods (i.e. Carthage users)?

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

No branches or pull requests

3 participants