Skip to content

Commit 2a77d02

Browse files
committed
fix: use semicolon separator for IlcAdditionalLinkArgs
- Prevent MSBuild from parsing /LIBPATH as command line switch - Use semicolon to separate multiple linker arguments - Wrap entire value in quotes for safety
1 parent 823a3ce commit 2a77d02

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/crossCompile/xwinSetup.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,9 @@ export async function getWindowsCrossCompileArgs(runtime: string): Promise<{
195195
].filter(p => fs.existsSync(p));
196196

197197
// 通过 IlcAdditionalLinkArgs 传递链接器参数
198-
const linkerArgs = libPaths.map(p => `/LIBPATH:"${p}"`).join(' ');
199-
args.push(`-p:IlcAdditionalLinkArgs=${linkerArgs}`);
198+
// 使用分号分隔多个参数,避免空格被 MSBuild 误解
199+
const linkerArgs = libPaths.map(p => `/LIBPATH:${p}`).join(';');
200+
args.push(`-p:IlcAdditionalLinkArgs="${linkerArgs}"`);
200201

201202
// 构建 LIB 环境变量 - lld-link 需要这个来查找库
202203
const libEnvPaths = libPaths.join(path.delimiter);

0 commit comments

Comments
 (0)