feat(cli): add --zig-link-only option (#1400)
This commit is contained in:
parent
1bcb3a3628
commit
bc41c9778f
1 changed files with 12 additions and 6 deletions
|
@ -191,6 +191,10 @@ export class BuildCommand extends Command {
|
||||||
)} ${chalk.green('--zig-abi-suffix=2.17')}`,
|
)} ${chalk.green('--zig-abi-suffix=2.17')}`,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
zigLinkOnly = Option.Boolean(`--zig-link-only`, false, {
|
||||||
|
description: `Only link the library with ${chalk.green('zig')}`,
|
||||||
|
})
|
||||||
|
|
||||||
isStrip = Option.Boolean(`--strip`, false, {
|
isStrip = Option.Boolean(`--strip`, false, {
|
||||||
description: `${chalk.green('Strip')} the library for minimum file size`,
|
description: `${chalk.green('Strip')} the library for minimum file size`,
|
||||||
})
|
})
|
||||||
|
@ -402,12 +406,14 @@ export class BuildCommand extends Command {
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const envTarget = triple.raw.replaceAll('-', '_').toUpperCase()
|
const envTarget = triple.raw.replaceAll('-', '_').toUpperCase()
|
||||||
|
if (!this.zigLinkOnly) {
|
||||||
Object.assign(additionalEnv, {
|
Object.assign(additionalEnv, {
|
||||||
CC: CCWrapperShell,
|
CC: CCWrapperShell,
|
||||||
CXX: CXXWrapperShell,
|
CXX: CXXWrapperShell,
|
||||||
TARGET_CC: CCWrapperShell,
|
TARGET_CC: CCWrapperShell,
|
||||||
TARGET_CXX: CXXWrapperShell,
|
TARGET_CXX: CXXWrapperShell,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
additionalEnv[`CARGO_TARGET_${envTarget}_LINKER`] = linkerWrapperShell
|
additionalEnv[`CARGO_TARGET_${envTarget}_LINKER`] = linkerWrapperShell
|
||||||
}
|
}
|
||||||
debug(`Platform: ${JSON.stringify(triple, null, 2)}`)
|
debug(`Platform: ${JSON.stringify(triple, null, 2)}`)
|
||||||
|
|
Loading…
Reference in a new issue