What are the dusty corners a newcomer to CMake will want to know?

前端 未结 2 1129
眼角桃花
眼角桃花 2020-12-08 16:51

I\'ve done a lot of projects and a lot of different build systems and CI tools. Most recently, I\'ve been exposed to the occasionally challenging task of adding to an autot

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-08 17:14

    One thing that took me a while to figure out: if anything goes haywire with a build because I've changed a compiler option, added/removed a .c file, had confusion with support library versions, etc. - it's best to delete the build tree and run CMake from scratch. Otherwise, even though CMake and make seem to do their job, the resulting executable crashes.

    It could be we're "not doing it right", but that's becoming a common problem with many tools, languages, frameworks, etc. It's not possible for everyone to be expert at all the software they depend on, and "not doing it right" is the only way a lot of things get done even among professionals. CMake is pretty smart about a lot of things, but not everything. Nuking the build tree remains a commonly used technique on our project.

提交回复
热议问题