Fix finding llvm src dir for current emsdk layout

This commit is contained in:
Aidan Hobson Sayers 2014-11-09 13:20:53 +00:00
Родитель 31df184c45
Коммит 82e068c507
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -312,10 +312,16 @@ def check_llvm_version():
# look for emscripten-version.txt files under or alongside the llvm source dir
def get_fastcomp_src_dir():
d = LLVM_ROOT
emroot = path_from_root() # already abspath
# look for version file in llvm repo, making sure not to mistake the emscripten repo for it
while d != os.path.dirname(d):
# look for version file in llvm repo, making sure not to mistake the emscripten repo for it
if os.path.exists(os.path.join(d, 'emscripten-version.txt')) and not os.path.abspath(d) == os.path.abspath(path_from_root()):
d = os.path.abspath(d)
# when the build directory lives below the source directory
if os.path.exists(os.path.join(d, 'emscripten-version.txt')) and not d == emroot:
return d
# when the build directory lives alongside the source directory
elif os.path.exists(os.path.join(d, 'src', 'emscripten-version.txt')) and not os.path.join(d, 'src') == emroot:
return os.path.join(d, 'src')
else:
d = os.path.dirname(d)
return None