def dir_from_output(output):
"""Get library directory based on the output of clang.
Args:
output (str): raw output from clang
Returns:
str: path to folder with libclang
"""
log.debug("real output: %s", output)
if platform.system() == "Darwin":
# [HACK] uh... I'm not sure why it happens like this...
folder_to_search = path.join(output, '..', '..')
log.debug("folder to search: %s", folder_to_search)
return folder_to_search
elif platform.system() == "Windows":
log.debug("architecture: %s", platform.architecture())
return path.normpath(output)
elif platform.system() == "Linux":
return path.normpath(path.dirname(output))
return None
评论列表
文章目录