I have Swift Framework project that uses the KissXML Objective-C library. KissXML internally uses libxml.
When I build the xcode project (Xcode 6 - beta 5), I get t
The trick is to create a module and include it on your project.
To create the module you create a file named, let's say, module.modulemap which exports the API on the header files of interest like this:
module libxmlModuleDevice {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
module libxmlModuleSimulator {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
Notice that you need to do this both for the simulator and for the actual device - hence the 2 entries on the file.
This file module.modulemap can be placed anywhere. I created a directory called modules at the same level as the Xcode's project file (.xcodeproj) and placed the module.modulemap file there.
Then add directory that contains this file to the Header Search Path under Build Settings of you Xcode project.
In this example all you have to do is to add the word modules to the Header Search Path because the modules directory is at the same level as the Xcode project file. This will update internally the Xcode project variable HEADER_SEARCH_PATHS. That's it.
in xcode6, iphone8.3, the path will be
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/usr/include/libxml2
*update:
a more easy way:
$(SDKROOT)/usr/include/libxml2
thank to:
iPhone libxml2 not found during build