make mkdoc now works with the libclang distribution from Apple

This commit is contained in:
Wenzel Jakob 2016-04-19 13:33:21 +02:00
parent e65e58716e
commit afb9c1776a

View File

@ -12,11 +12,6 @@ from collections import OrderedDict
from threading import Thread, Semaphore from threading import Thread, Semaphore
from multiprocessing import cpu_count from multiprocessing import cpu_count
if platform.system() == 'Darwin':
libclang = '/opt/llvm/lib/libclang.dylib'
if os.path.exists(libclang):
cindex.Config.set_library_path(os.path.dirname(libclang))
RECURSE_LIST = [ RECURSE_LIST = [
CursorKind.TRANSLATION_UNIT, CursorKind.TRANSLATION_UNIT,
CursorKind.NAMESPACE, CursorKind.NAMESPACE,
@ -188,6 +183,17 @@ if __name__ == '__main__':
parameters = ['-x', 'c++', '-std=c++11'] parameters = ['-x', 'c++', '-std=c++11']
filenames = [] filenames = []
if platform.system() == 'Darwin':
libclang = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib'
if os.path.exists(libclang):
cindex.Config.set_library_path(os.path.dirname(libclang))
base_path = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs'
if os.path.exists(base_path):
sysroot = os.path.join(base_path, next(os.walk(base_path))[1][0])
parameters.append('-isysroot')
parameters.append(sysroot)
for item in sys.argv[1:]: for item in sys.argv[1:]:
if item.startswith('-'): if item.startswith('-'):
parameters.append(item) parameters.append(item)