开发者

Visual Studio 2005 Pre-link Event: Any way to get linker input file names?

I've made a tool that operates directly on .obj files before they are linked. I can specify my tool on the pre-link event command line and manually specify each .obj file, but is there any macro or tech开发者_StackOverflow社区nique that I can use that will automatically include all .obj files from a particular project? There are other .obj files in the same directory from other projects in my solution that I don't want to include, so I can't do a *.obj.

The tool itself is part of the same solution. It is compiled first and then some of the other projects use this tool before they are linked.


The solution that I have come up with is to use a unique intermediate directory for each project. Then I can use the following pre-link event command line:

cd $(IntDir) && for %%f in (*.obj) do $(OutDir)\myTool.exe -flags %%f

When $(OutDir) is common among all projects in the solution, and the dependency order enforces that myTool.exe is compiled first, then the above works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜