Skip to content

Commit c55ca98

Browse files
committed
improve ifort rootdir
1 parent b3f983a commit c55ca98

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xmake/modules/detect/sdks/find_ifortenv.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ function _load_ifortvars(ifortvars_bat, arch, opt)
5353
file:close()
5454

5555
-- run genifortvars.bat
56-
os.run(genifortvars_bat)
56+
local oneapi_rootdir = os.getenv("ONEAPI_ROOT")
57+
if not oneapi_rootdir then
58+
oneapi_rootdir = path.directory(ifortvars_bat)
59+
end
60+
os.runv(genifortvars_bat, {envs = {ONEAPI_ROOT = oneapi_rootdir}})
5761

5862
-- load all envirnoment variables
5963
local variables = {}

0 commit comments

Comments
 (0)