diff options
| author | indesperate <[email protected]> | 2022-12-27 16:51:42 +0800 |
|---|---|---|
| committer | indesperate <[email protected]> | 2022-12-27 16:58:10 +0800 |
| commit | 8b67774092dcbc29fe859ee7fb976b666d889c86 (patch) | |
| tree | b65d5d1a33c2afb5b3cb1edaec3bd9c9fb9ab652 | |
| parent | 560955f0f8717e104fe77bef17f8d107b1446f80 (diff) | |
add support for COMPILER environment variables
| -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 |
