diff options
| -rw-r--r-- | xmake/modules/detect/sdks/find_iccenv.lua | 12 | ||||
| -rw-r--r-- | xmake/modules/detect/sdks/find_ifortenv.lua | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/xmake/modules/detect/sdks/find_iccenv.lua b/xmake/modules/detect/sdks/find_iccenv.lua index 84b40fade..68428f6fb 100644 --- a/xmake/modules/detect/sdks/find_iccenv.lua +++ b/xmake/modules/detect/sdks/find_iccenv.lua @@ -104,7 +104,17 @@ function _find_intel_on_windows(opt) local iclvars_bat = find_file("bin/iclvars.bat", paths) -- look for setvars.bat which is new in 2021 if not iclvars_bat then - paths = {"$(env ICPP_COMPILER21)"} + -- find setvars.bat in intel oneapi toolkits rootdir + paths = {"$(env ONEAPI_ROOT)"} + iclvars_bat = find_file("setvars.bat", paths) + end + if not iclvars_bat then + -- find setvars.bat using ICPP_COMPILER.* + paths = { + "$(env ICPP_COMPILER21)", + "$(env ICPP_COMPILER22)", + "$(env ICPP_COMPILER23)" + } iclvars_bat = find_file("../../../setvars.bat", paths) end if iclvars_bat then diff --git a/xmake/modules/detect/sdks/find_ifortenv.lua b/xmake/modules/detect/sdks/find_ifortenv.lua index d851b3f6a..917ff7057 100644 --- a/xmake/modules/detect/sdks/find_ifortenv.lua +++ b/xmake/modules/detect/sdks/find_ifortenv.lua @@ -104,7 +104,17 @@ function _find_intel_on_windows(opt) local ifortvars_bat = find_file("bin/ifortvars.bat", paths) -- look for setvars.bat which is new in 2021 if not ifortvars_bat then - paths = {"$(env IFORT_COMPILER21)"} + -- find setvars.bat in intel oneapi toolkits rootdir + paths = {"$(env ONEAPI_ROOT)"} + ifortvars_bat = find_file("setvars.bat", paths) + end + if not ifortvars_bat then + -- find setvars.bat use IFORT_COMPILER.* + paths = { + "$(env IFORT_COMPILER21)", + "$(env IFORT_COMPILER22)", + "${env IFORT_COMPILER23)" + } ifortvars_bat = find_file("../../../setvars.bat", paths) end |
