Using Makefile instead of Solution/Project files under Visual Studio (2005)

后端 未结 5 1752
长情又很酷
长情又很酷 2021-02-20 04:08

Does anyone have experience using makefiles for Visual Studio C++ builds (under VS 2005) as opposed to using the project/solution setup. For us, the way that the project/soluti

5条回答
  •  故里飘歌
    2021-02-20 04:48

    I've found some benefits to makefiles with large projects, mainly related to unifying the location of the project settings. It's somewhat easier to manage the list of source files, include paths, preprocessor defines and so on, if they're all in a makefile or other build config file. With multiple configurations, adding an include path means you need to make sure you update every config manually through Visual Studio's fiddly project properties, which can get pretty tedious as a project grows in size.

    Projects which use a lot of custom build tools can be easier to manage too, such as if you need to compile pixel / vertex shaders, or code in other languages without native VS support.

    You'll still need to have various different project configurations however, since you'll need to differentiate the invocation of the build tool for each config (e.g. passing in different command line options to make).

    Immediate downsides that spring to mind:

    • Slower builds: VS isn't particularly quick at invoking external tools, or even working out whether it needs to build a project in the first place.
    • Awkward inter-project dependencies: It's fiddly to set up so that a dependee causes the base project to build, and fiddlier to make sure that they get built in the right order. I've had some success getting SCons to do this, but it's always a challenge to get working well.
    • Loss of some useful IDE features: Edit & Continue being the main one!

    In short, you'll spend less time managing your project configurations, but more time coaxing Visual Studio to work properly with it.

提交回复
热议问题