使用prebuild事件重新定位解决方案SDK [英] Using a prebuild event to retarget a solution SDK

查看:74
本文介绍了使用prebuild事件重新定位解决方案SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的存储库中有一个子模块,它包含一个需要构建的解决方案,以便编译我的程序。

I have a submodule in my repository that holds a solution that needs to be built in order for my program to be compiled.

我通过运行此命令来构建它aa我自己项目的预构建事件:

I build it by running this command a a pre-build event for my own project:

msbuild.exe" $(ProjectDir)dependencies\submodule \submodule.sln" / t:构建/ p:配置= $(配置);平台= $(平台)

msbuild.exe "$(ProjectDir)dependencies\submodule\submodule.sln" /t:Build /p:Configuration=$(Configuration);Platform=$(Platform)

问题是,该解决方案中的所有24个项目都针对Windows 8.1 SDK,但是我需要它们来定位Win10 SDK中的一个。

The problem is, all the 24 projects in that solution are targeted at Windows 8.1 SDK, but I need them to target one of the Win10 SDK.

有没有一种方法可以使用MSBuild,在项目构建之前将项目重新定位到所需的SDK?或者任何解决方案,只要它可以使用预构建事件系统来实现,因为这是确保它适用于克隆存储库的任何
的唯一方法。

Is there a way I can use MSBuild in way that it retargets the projects to the desired SDK before it builds them? Or any solution really, as long as it can be realized using pre-build event system, since that is the only way to make sure it works for anyone who clones the repository.

推荐答案

想出来。任何属性都可以更改。

Figured it out. Any property can be changed.

msbuild.exe"

msbuild.exe "


(ProjectDir)dependencies \submodule \ submodule.sln" / t:Build / p:Configuration =
(ProjectDir)dependencies\submodule\submodule.sln" /t:Build /p:Configuration=


(配置); Platform =
(Configuration);Platform=


这篇关于使用prebuild事件重新定位解决方案SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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