Keeping track of source code variants

后端 未结 6 1755
眼角桃花
眼角桃花 2021-02-06 02:03

I am soon starting to maintain a line of products containing variants of the same embedded software. Since I\'ve been playing with git for one year and appreciate it very much,

6条回答
  •  抹茶落季
    2021-02-06 02:40

    You are in for a world of hurt!

    Whatever you do, you need an automatic build environment. At the very least you need some automatic way of building all the different versions of your firmware. I've had issues of fixing a bug in one version and breaking the build of a different version.

    Ideally you would be able to load the different targets and run some smoke tests.

    If you go the #define route, I would put the following someplace where the variant is checked:

    #else 
        #error You MUST specify a variant!
    #endif
    

    This will make sure all the files are built for the same variant during the build process.

提交回复
热议问题