[英]Visual Studio automated build: Makefile vs Project.sln
I want to automate the build process of my C++ application outside the Visual Studio IDE, via commandline. 我想通过命令行在Visual Studio IDE之外自动执行C ++应用程序的生成过程。
Currently I use devenv.com <solution-name>.sln /clean "Release|Win32" /project <project-name> /projectconfig "Release|Win32"
to build the solution. 目前,我使用
devenv.com <solution-name>.sln /clean "Release|Win32" /project <project-name> /projectconfig "Release|Win32"
来构建解决方案。
There are several pre-build and post-build tasks that I configure inside the solution in the project config. 我在项目配置中的解决方案内部配置了一些构建前和构建后任务。
My question is: Is it recommended for an automated build process or I should use makefiles? 我的问题是:建议将其用于自动构建过程,还是应该使用makefile? If none of them, what approach should I use?
如果都不使用,应该使用哪种方法? (havind in mind that I need a reliable solution).
(请记住,我需要一个可靠的解决方案)。
Thanks. 谢谢。
It is not easy to build windows application with Makefile. 用Makefile构建Windows应用程序并不容易。 You have to do a lot of work which is already done in msbuild.
您必须做很多在msbuild中已经完成的工作。 And you gain problems with visual studio integration.
而且,Visual Studio集成会遇到问题。 So I will definitely for building application from solution with msbuild.
因此,我肯定会使用msbuild从解决方案构建应用程序。
Now for that additional tasks. 现在,执行其他任务。 Microsoft is not flexible in adding extra tasks.
Microsoft在添加额外任务方面并不灵活。 But if pre-build and post-build steps in a solution are sufficient for your needs, it is better to stick to one build system and use them.
但是,如果解决方案中的构建前和构建后步骤足以满足您的需求,则最好坚持使用一个构建系统并使用它们。 If you need something more powerful, it is worth using normal build system (makefiles are good and great, but now there are more easy to use alternatives, such as gradle, CMake and many more) and describe that extra steps in it, but still build application with msbuild.
如果您需要更强大的功能,则值得使用常规的构建系统(makefile很好,但是现在有更多易于使用的替代方法,例如gradle,CMake等),并在其中描述了额外的步骤,但是仍然使用msbuild构建应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.