如何使用Visual Studio命令行+ SCons构建Windows XP应用程序? [英] How to build windows xp application using Visual studio command line + SCons?

查看:259
本文介绍了如何使用Visual Studio命令行+ SCons构建Windows XP应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2015 IDE构建Windows XP应用程序一点都不难,您只需要使用正确的平台工具集(v120_xp或v140_xp),并确保在目标上安装了正确的可再发行的Visual Studio运行时dll即可.机器,轻松自如.

Building a windows xp application using Visual Studio 2015 IDE isn't hard at all, you just need to use the right platform toolset (v120_xp or v140_xp) and just make sure you install the proper redistributable visual studio runtime dlls on the target machine, easy peasy.

现在,我一直在尝试找出如何在不使用VS GUI而是使用 VS2015命令行+ SCons

Now, I've been trying to figure out how to build a windows xp application targetting windows xp without using the VS GUI but using VS2015 command line + SCons

所有SCons标志都已记录在此处,但我什么也没看到允许我更改平台工具集.

All the SCons flags are docummented here but I don't see anything that allows me to change the platform toolset.

如果您想知道平台工具集标志的真正含义是什么……经过一番研究,我能够弄清楚该标志的真正作用是基本上产生适合目标机器加载程序的不同PE标头,那么您可以看到下面4种不同情况(v120,v120_xp,v140,v140_xp)之间的一些比较:

If you wonder what's the real meaning of the platform toolset flag... after some research I've been able to figure out what that flag really does is basically producing different PE headers that are suitable for the target machine loader, you can see a little comparison between 4 different cases below (v120, v120_xp, v140, v140_xp):

问题:使用visual studio command line或使用visual studio command line + SCons时如何更改Visual Studio平台工具集?

Question: How can i change the visual studio platform toolset when using visual studio command line or when using visual studio command line + SCons?

我发现了这个

I've found this Can I set the platform toolset from the command line when building with VS2010's msbuild? but I'm not sure whether that could be used via SCons :/

推荐答案

经过大量的挖掘,我发现了最好的策略,可以更多地了解平台工具集,这意味着手动比较此标志将如何影响两个cllink,我已经做到了,这是我的发现:

After a lot of digging I've found out the best strategy to know more about the platform toolset meaning was comparing manually how this flag would affect both cl and link, I've already done that and here's my findings:

v120_xp
-------
link: /SUBSYSTEM:CONSOLE",5.01"
cl: /D "_USING_V110_SDK71_"

v120
----
link: /SUBSYSTEM:CONSOLE
cl:

v140_xp
--------
link: /SUBSYSTEM:CONSOLE",5.01"
cl: /D "_USING_V110_SDK71_" /Zc:inline

v140
-------
link: /SUBSYSTEM:CONSOLE
cl: /Zc:inline

我已经提取了所有通用参数,只留下了受平台工具集影响的相关参数.为了了解有关整个主题的更多信息,建议您特别阅读/SUBSYSTEM 标志.

I've extracted out all common parameters and left only the relevant ones affected by platform toolset. In order to know more about this whole subject I'd recommend you to read specially about the /SUBSYSTEM flags from official docs.

此外,Executable/Include/Library/Exclude目录将被调整为使用Windows SDK 7.

Also, the Executable/Include/Library/Exclude directories will be adjusted to use windows SDK 7.

剩下的事情是将这些标志与SCons集成在一起,这应该很容易,例如,您只需要将这些标志添加到

Remaining thing is to integrate these flags with SCons, that should be easy enough, for instance, you just need to adds these flags to the nuitka environment

这篇关于如何使用Visual Studio命令行+ SCons构建Windows XP应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆