diff options
| -rw-r--r-- | xmake/modules/detect/sdks/find_iccenv.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/detect/sdks/find_ifortenv.lua | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/xmake/modules/detect/sdks/find_iccenv.lua b/xmake/modules/detect/sdks/find_iccenv.lua index be50d9ec5..68428f6fb 100644 --- a/xmake/modules/detect/sdks/find_iccenv.lua +++ b/xmake/modules/detect/sdks/find_iccenv.lua @@ -102,11 +102,21 @@ function _find_intel_on_windows(opt) -- find iclvars_bat.bat local paths = {"$(env ICPP_COMPILER20)"} local iclvars_bat = find_file("bin/iclvars.bat", paths) + -- look for setvars.bat which is new in 2021 if not iclvars_bat then -- 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 -- load iclvars_bat diff --git a/xmake/modules/detect/sdks/find_ifortenv.lua b/xmake/modules/detect/sdks/find_ifortenv.lua index d7a5e5bee..917ff7057 100644 --- a/xmake/modules/detect/sdks/find_ifortenv.lua +++ b/xmake/modules/detect/sdks/find_ifortenv.lua @@ -102,11 +102,21 @@ function _find_intel_on_windows(opt) -- find ifortvars_bat.bat local paths = {"$(env IFORT_COMPILER20)"} local ifortvars_bat = find_file("bin/ifortvars.bat", paths) + -- look for setvars.bat which is new in 2021 if not ifortvars_bat then -- 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 if ifortvars_bat then |
