使用 Visual Studio 2010 的构建代理的宏和输出

发布于 2024-10-16 17:51:04 字数 1032 浏览 5 评论 0原文

我正在尝试让团队建设和构建代理首次为我们的应用程序工作。我在进行项目设置的方式上遇到了一些问题,这些问题对于我正在尝试清理的构建代理来说效果不佳。不过,我想问一下我“发现”的关于构建代理的问题以及它们如何工作,看看我是否正确,或者我是否只是错过了一些可以让事情变得更容易的明显的事情。因此,这是我到目前为止所遇到的事情,请告诉我是否正确或纠正我的错误:

1) 构建代理更改 $(Outdir) 宏以将所有内容发送到二进制文件。这意味着,如果我们有项目将输出发送到自定义文件夹(如 ....\bin),并且构建后步骤引用 ....\bin,则构建后步骤将失败,因为在构建代理上,输出将失败不要在垃圾箱里。我们现在必须使用构建后步骤从 $(Outdir) 复制到 ....\bin 以获得我们想要的输出。

2) Linker->General->Register Output 不适用于任何机器上的 x64 版本,因为它似乎不够智能,无法将 system32 regsvr32 用于 x64,而是尝试使用 32 位版本。

3) 链接器 -> 常规 -> 注册输出不适用于构建代理上的 Win32 构建,因为它不够智能,无法使用 $(Output) 文件夹,而是尝试从 .\$(Platform) 注册文件)\$(Configuration)\filename.dll 但该文件不在构建代理上。

为了解决问题 2 和 3,我已转而使用构建后注册步骤来注册我们的 dll,因此:

c:\windows\syswow64\regsvr32.exe  $(TargetPath) //32 bit
c:\windows\system32\regsvr32.exe  $(TargetPath) //64 bit  

我希望找到一个宏来替换 syswow64 和 system32,该宏将根据平台使用正确的宏这些行是相同的(我更喜欢让所有平台和配置的后期构建步骤尽可能相同),但到目前为止我找不到一个。
我发现不可能相信不会有 $(SystemFolder) 宏或类似的东西,有人可以告诉我是否有一个以及它在哪里/是什么?

还有其他类似的隐藏问题我可能会遇到吗? 感谢您的帮助。

I'm trying to get team build and build agents working for our app for the first time. I've run into a few issues with the way we do our project settings which don't work well for build agents that I'm trying to clean up. However I'd like to ask about the issues I've "discovered" about build agents and how they work to see if I'm correct, or if I'm just missing obvious things that would make it easier. So here are the things that I have hit so far, please tell me if I am correct or correct me where I'm wrong:

1) Build agents change the $(Outdir) macros to send everything to the Binaries. This means that if we had projects sending our output to a custom folder like ....\bin, and a post build step that references ....\bin the post build step will fail because on the build agent the output won't be in bin. We now have to use a post build step to copy from $(Outdir) to ....\bin to get the output where we want it.

2) The Linker->General->Register Output does not work for an x64 build on any machine as it seems to be not smart enough to use the system32 regsvr32 for x64 and instead tries to use the 32bit version.

3) The Linker->General->Register Output does not work for a Win32 build on a build agent because it's not smart enough to use the $(Output) folder and instead tries to register the file from .\$(Platform)\$(Configuration)\filename.dll but the file isn't there on a build agent.

To solve issues 2 and 3 I've switched to using a post build registration step to register our dlls, so either:

c:\windows\syswow64\regsvr32.exe  $(TargetPath) //32 bit
c:\windows\system32\regsvr32.exe  $(TargetPath) //64 bit  

I would love to find a macro to replace syswow64 and system32 that would just use the correct one depending on the platform to make these lines the same (i prefer to have my post build steps identical for all platforms and configurations as much as possible) but so far i can't find one.
I find it impossible to believe that there wouldn't be a $(SystemFolder) macro or something like that can someone tell me if there is one and where/what it is?

Also are there any other hidden issues like this that I may run into?
Thanks for all your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文