From 3b642389f2ca3f7093ee694a0256e423780e82d7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 18 Feb 2020 11:01:34 +0000 Subject: [PATCH] First attempt at 32 bit windows building --- scripts/hak/hakEnv.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/hak/hakEnv.js b/scripts/hak/hakEnv.js index 6752d55..265a41d 100644 --- a/scripts/hak/hakEnv.js +++ b/scripts/hak/hakEnv.js @@ -42,6 +42,17 @@ function getTarget(packageJson) { } } +function detectArch() { + if (process.platform === 'win32') { + const targetArch = process.env.VSCMD_ARG_TGT_ARCH; + if (targetArch === 'x86') { + return 'ia32'; + } else if (targetArch === 'x64') { + return 'x64'; + } + } + return process.arch; +} module.exports = class HakEnv { constructor(prefix, packageJson) { @@ -50,7 +61,7 @@ module.exports = class HakEnv { runtime: getRuntime(packageJson), target: getTarget(packageJson), platform: process.platform, - arch: process.arch, + arch: detectArch(), // paths projectRoot: prefix,