|
95 | 95 |
|
96 | 96 | -- find intel llvm c/c++ envirnoment on windows
|
97 | 97 | function _find_intel_on_windows(opt)
|
98 |
| - |
99 |
| - -- init options |
100 | 98 | opt = opt or {}
|
101 | 99 |
|
102 | 100 | -- find icxvars_bat.bat
|
103 |
| - local paths = {"$(env ICPP_COMPILER20)"} |
104 |
| - local icxvars_bat = find_file("bin/icxvars.bat", paths) |
105 |
| - -- look for setvars.bat which is new in 2021 |
106 |
| - if not icxvars_bat then |
107 |
| - -- find setvars.bat in intel oneapi toolkits rootdir |
108 |
| - paths = {"$(env ONEAPI_ROOT)"} |
109 |
| - icxvars_bat = find_file("setvars.bat", paths) |
110 |
| - end |
| 101 | + local paths = {"$(env ONEAPI_ROOT)"} |
| 102 | + local icxvars_bat = find_file("setvars.bat", paths) |
111 | 103 | if not icxvars_bat then
|
112 |
| - -- find setvars.bat using ICPP_COMPILER.* |
113 |
| - paths = { |
114 |
| - "$(env ICPP_COMPILER21)", |
115 |
| - "$(env ICPP_COMPILER22)", |
116 |
| - "$(env ICPP_COMPILER23)" |
117 |
| - } |
118 |
| - icxvars_bat = find_file("../../../setvars.bat", paths) |
| 104 | + paths = {} |
| 105 | + local keys = winos.registry_keys("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Intel\\DPCPPSuites\\**\\DPC++") |
| 106 | + for _, key in ipairs(keys) do |
| 107 | + table.insert(paths, format("$(reg %s;ProductDir)", key)) |
| 108 | + end |
| 109 | + icxvars_bat = find_file("../../setvars.bat", paths) |
119 | 110 | end
|
120 | 111 | if icxvars_bat then
|
121 |
| - |
122 |
| - -- load icxvars_bat |
123 | 112 | local icxvars_x86 = _load_icxvars(icxvars_bat, "ia32", opt)
|
124 | 113 | local icxvars_x64 = _load_icxvars(icxvars_bat, "intel64", opt)
|
125 |
| - |
126 |
| - -- save results |
127 | 114 | return {icxvars_bat = icxvars_bat, icxvars = {x86 = icxvars_x86, x64 = icxvars_x64}}
|
128 | 115 | end
|
129 | 116 | end
|
|
0 commit comments