Build: Unify windows and linux find executable code
This commit is contained in:
parent
6d5f8f5b2b
commit
0f68481a09
22
Configure.py
22
Configure.py
|
@ -49,23 +49,11 @@ DEFAULT_ERROR_MESSAGE = (
|
|||
|
||||
|
||||
def FindExecutable(candidates : list):
|
||||
if os.name == 'nt':
|
||||
# TODO: test if find_executable(e) works properly for windows and unify windows and linux code if works
|
||||
for e in candidates:
|
||||
ec = subprocess.call(
|
||||
[ 'where' if os.name == 'nt' else 'whereis', e ],
|
||||
stdout = subprocess.PIPE,
|
||||
stderr = subprocess.PIPE,
|
||||
shell = True)
|
||||
if ec == 0:
|
||||
return e
|
||||
return None
|
||||
else:
|
||||
for e in candidates:
|
||||
find_executable(e)
|
||||
if e:
|
||||
return e
|
||||
return None
|
||||
for e in candidates:
|
||||
executable_path = find_executable(e)
|
||||
if executable_path:
|
||||
return e
|
||||
return None
|
||||
|
||||
DEFAULT_C_COMPILER = FindExecutable([
|
||||
'cl',
|
||||
|
|
Loading…
Reference in New Issue