简体   繁体   English

Visual Studio自动生成:Makefile与Project.sln

[英]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.

相关问题 使用 CMake 构建 project.sln 时发布构建事件错误 - Post build event error when building project.sln with CMake 是否将源文件添加到包含Project.sln或Project.vcxproj的文件夹中? - Do I add source files to the folder containg Project.sln or Project.vcxproj? 如何让qmake在Visual Studio .sln项目中生成“项目依赖项” - How to get qmake to generate “project dependencies” in a Visual Studio .sln project 没有sln文件时使用Visual Studio 2015打开解决方案/项目 - Opening Solution / Project with Visual studio 2015 when there is no sln file 将没有.sln的项目从GitHub克隆到Visual Studio 2015中 - cloning a project without .sln from GitHub into visual studio 2015 VS 2019(Visual Studio)Linux makefile 项目 - 从 windows 编译时“没有这样的文件或目录” - VS 2019 (Visual studio) Linux makefile project - 'No such file or directory' when compiling from windows 在Visual Studio 2013中包含Makefile的项目 - Project containing makefile in Visual Studio 2013 将MinGW与Visual Studio 2010集成(Makefile项目) - Integrate MinGW with Visual Studio 2010 (Makefile Project) Visual Studio Makefile项目,具有多个输出 - Visual Studio Makefile Project With several output 由于链接的前缀而无法生成Visual Studio 2017 Linux Makefile项目 - Visual Studio 2017 Linux Makefile Project won't build because of chained prefix
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM