diff options
| -rw-r--r-- | xmake/modules/detect/sdks/find_ifortenv.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/detect/sdks/find_ifortenv.lua b/xmake/modules/detect/sdks/find_ifortenv.lua index 7c9665506..2a6f937d4 100644 --- a/xmake/modules/detect/sdks/find_ifortenv.lua +++ b/xmake/modules/detect/sdks/find_ifortenv.lua @@ -53,7 +53,11 @@ function _load_ifortvars(ifortvars_bat, arch, opt) file:close() -- run genifortvars.bat - os.run(genifortvars_bat) + local oneapi_rootdir = os.getenv("ONEAPI_ROOT") + if not oneapi_rootdir then + oneapi_rootdir = path.directory(ifortvars_bat) + end + os.runv(genifortvars_bat, {envs = {ONEAPI_ROOT = oneapi_rootdir}}) -- load all envirnoment variables local variables = {} |
