Skip to content

Commit ac71c58

Browse files
committed
fix x64 recognition for clang and icc
1 parent cd2aa28 commit ac71c58

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

win32/build/confutils.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,16 +2361,17 @@ function toolset_get_compiler_name()
23612361
function toolset_is_64()
23622362
{
23632363
if (VS_TOOLSET) {
2364-
return probe_binary(PHP_CL, 64, null, 'PHP_CL');
2364+
return probe_binary(PHP_CL, 64);
23652365
} else if (CLANG_TOOLSET) {
2366-
/* Seems to be impossible to get it from the clang binary, so lets use the normal cl.exe,
2367-
as clang should be running in VS environment. */
2368-
var vs_cl = PATH_PROG('cl', null, 'PHP_CL')
2369-
return probe_binary(vs_cl, 64);
2366+
var command = 'cmd /c ""' + PHP_CL + '" -v"';
2367+
var full = execute(command + '" 2>&1"');
2368+
2369+
return null != full.match(/x86_64/);
23702370
} else if (INTEL_TOOLSET) {
2371-
/*seems the easiest way as well for now */
2372-
var vs_cl = PATH_PROG('cl', null, 'PHP_CL')
2373-
return probe_binary(vs_cl, 64);
2371+
var command = 'cmd /c ""' + PHP_CL + '" -v"';
2372+
var full = execute(command + '" 2>&1"');
2373+
2374+
return null != full.match(/Intel\(R\) 64/);
23742375
}
23752376

23762377
ERROR("Wrong toolset");

0 commit comments

Comments
 (0)