diff options
| author | ruki <[email protected]> | 2024-05-23 23:05:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-05-23 23:05:18 +0800 |
| commit | 2322a631b30ca69cd719e0acb1ba4ec735a26b81 (patch) | |
| tree | cc1a6b9ec8cb059bf26ed8f48b8ba577ede3c333 | |
| parent | 31dae5851e114d2e183b6957e062f14831a73a82 (diff) | |
improve to find icx
| -rw-r--r-- | xmake/modules/detect/sdks/find_icxenv.lua | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/xmake/modules/detect/sdks/find_icxenv.lua b/xmake/modules/detect/sdks/find_icxenv.lua index df0c50dde..4e2293415 100644 --- a/xmake/modules/detect/sdks/find_icxenv.lua +++ b/xmake/modules/detect/sdks/find_icxenv.lua @@ -95,35 +95,22 @@ end -- find intel llvm c/c++ envirnoment on windows function _find_intel_on_windows(opt) - - -- init options opt = opt or {} -- find icxvars_bat.bat - local paths = {"$(env ICPP_COMPILER20)"} - local icxvars_bat = find_file("bin/icxvars.bat", paths) - -- look for setvars.bat which is new in 2021 - if not icxvars_bat then - -- find setvars.bat in intel oneapi toolkits rootdir - paths = {"$(env ONEAPI_ROOT)"} - icxvars_bat = find_file("setvars.bat", paths) - end + local paths = {"$(env ONEAPI_ROOT)"} + local icxvars_bat = find_file("setvars.bat", paths) if not icxvars_bat then - -- find setvars.bat using ICPP_COMPILER.* - paths = { - "$(env ICPP_COMPILER21)", - "$(env ICPP_COMPILER22)", - "$(env ICPP_COMPILER23)" - } - icxvars_bat = find_file("../../../setvars.bat", paths) + paths = {} + local keys = winos.registry_keys("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Intel\\DPCPPSuites\\**\\DPC++") + for _, key in ipairs(keys) do + table.insert(paths, format("$(reg %s;ProductDir)", key)) + end + icxvars_bat = find_file("../../setvars.bat", paths) end if icxvars_bat then - - -- load icxvars_bat local icxvars_x86 = _load_icxvars(icxvars_bat, "ia32", opt) local icxvars_x64 = _load_icxvars(icxvars_bat, "intel64", opt) - - -- save results return {icxvars_bat = icxvars_bat, icxvars = {x86 = icxvars_x86, x64 = icxvars_x64}} end end |
