Fix finding llvm src dir for current emsdk layout
This commit is contained in:
Родитель
31df184c45
Коммит
82e068c507
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче