VS2015 集成 YASM 1.3

系统:Windows 10

IDE:VS2015

任务:集成 YASM 1.3

官网:http://yasm.tortall.net/Download.html

照做后,得到一个错误:

1
error MSB3721: The command "......" exited with code 1.

直接跑命令则提示:

1
vsyasm: FATAL: unrecognized object format `Win32'

原因:区分大小写……应该用 win32 而不是 Win32,您可以改一下工程平台的名字,但默认都是 Win32,不太方便,所以我们要对 vsyasm.props 进行改造:

1
<CommandLineTemplate>"$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs]</CommandLineTemplate>

替换为:

1
<CommandLineTemplate>"$(YasmPath)vsyasm.exe" -Xvc -f $(Platform.ToLower()) [AllOptions] [AdditionalOptions] [Inputs]</CommandLineTemplate>

或者:

1
<CommandLineTemplate>"$(YasmPath)vsyasm.exe" -Xvc -f win$(PlatformArchitecture) [AllOptions] [AdditionalOptions] [Inputs]</CommandLineTemplate>

保存即搞定,连 VS 都不需要重启。

如果您使用微信,也可以关注公众号 UMU618,在公众号文章里评论。