Skip to content

Commit 71a1f3a

Browse files
authored
Add check for ONEAPI_ROOT dir (#411)
1 parent 20f9825 commit 71a1f3a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,18 @@ def _get_cmdclass():
102102

103103

104104
def spirv_compile():
105+
ONEAPI_ROOT = os.environ.get("ONEAPI_ROOT")
106+
if not os.path.isdir(ONEAPI_ROOT):
107+
raise ValueError(f"ONEAPI_ROOT is not a directory: {ONEAPI_ROOT}")
108+
105109
if IS_LIN:
106110
compiler = "compiler/latest/linux/bin/clang"
107-
compiler = os.path.join(os.environ.get("ONEAPI_ROOT"), compiler)
111+
compiler = os.path.join(ONEAPI_ROOT, compiler)
108112
compiler = shlex.quote(compiler)
109113
if IS_WIN:
110114
compiler = "compiler\\latest\\windows\\bin\\clang.exe"
111-
compiler = os.path.join(os.environ.get("ONEAPI_ROOT"), compiler)
115+
compiler = os.path.join(ONEAPI_ROOT, compiler)
116+
112117
clang_args = [
113118
compiler,
114119
"-flto",

0 commit comments

Comments
 (0)