glimpseio / GlimpseXML

Fast XML DOM parser & serializer in pure Swift for iOS & Mac
MIT License
8 stars 7 forks source link

Error building on Xcode 7; can't libxml2 and its headers #7

Open csidev opened 8 years ago

csidev commented 8 years ago

Thanks for creating updated version, I am trying to build the code on Xcode 7.3.1 and I keep getting the following two errors:

  1. In module.modulemap .../GlimpseXML/GlimpseXML/module.modulemap:2:10: Header '/usr/include/libxml2/libxml/xmlexports.h' not found
  2. .../GlimpseXML/GlimpseXML/GlimpseXML.swift:9:8: Could not build Objective-C module 'libxml2'

I have checked everything that I can think of.

Here is what I have tried so far: I have tried to change SDKROOT to SDK_DIR in build-settings->search-paths->Library-search-paths I have tried to put the full path of the headers in the module map instead of /usr/include.., it just fails in another place (cannot find libxml/xmlexports.h). I have also tried to specify oath in build-settings->search-paths->Framework-search-paths and build-settings->search-paths->Library-search-paths.

Please let me know if there is anything that I have missed.

joemcbride commented 7 years ago

For Xcode 7 / OSX 10.11 you have to update module.modulemap file to point to the new sdk files.

module libxml2 {
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/xmlexports.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/xmlversion.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/parser.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/xmlIO.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/xinclude.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/tree.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/xmlreader.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/xpath.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/xpathinternals.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/xmlstring.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/libxml/HTMLParser.h"
  export *
}

I believe Xcode 8 / MacOS 10.12 will require:

module libxml2 {
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/xmlexports.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/xmlversion.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/parser.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/xmlIO.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/xinclude.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/tree.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/xmlreader.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/xpath.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/xpathinternals.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/xmlstring.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/libxml/HTMLParser.h"
  export *
}