How to organize the project tree for a C++ project using nmake?

前端 未结 2 873
忘了有多久
忘了有多久 2020-12-30 03:06

There seems to be two major conventions for organizing project files and then many variations.

Convention 1: High-level type directories, project sub-direc

2条回答
  •  礼貌的吻别
    2020-12-30 03:54

    [A partial answer.]

    In "Convention 2: High-level project dirs, type sub-directories," your single con is

    If there are dependencies between projects, you need an additional layer of build scripts above the project directories to manage the build order

    That can also be viewed as a pro, in many projects.

    If you have a lot of repetitive general definitions, one would probably want an include file for the build scripts, where solution-wide constants & parameters could be defined. So the "additional layer of build scripts" will frequently happen anyway, even if there are no (direct) dependencies.

    It's a pro in that there's still room for a more modular approach in building. On the other hand, if you want to reuse a project in another, unrelated solution, you would need to compose a different definitions file. (On the other other hand, if there were a single build file for the whole solution, as in Convention 1, you would need a different build script.) As for your maintenance requirement, that's (IMO) very project-dependent.

    My feeling leans towards Convention 2, but it's far from a clear win. In fact, your experience with Convention 1, which was working well until recently, may be the biggest pro of all: a team of people with experience with a certain organization is a valuable asset.

提交回复
热议问题