3 ms·
The reason why people write all the source files in a list in a cmake file is that it means that when one developer adds a new file, everyone else's build syste
by ndiddy 3y ago
The reason why people write all the source files in a list in a cmake file is that it means that when one developer adds a new file, everyone else's build system automatically regenerates the next time they try to build the project. When you use globs (which cmake does support), it means that the CMakeLists.txt file doesn't get modified when adding a new file, so the cmake generated makefiles/ninjafiles/whatever have no way of knowing that the build was modified. Instead of having the build system regenerate and then the build go through, they get a linker error and have to manually run "cmake -B build" or whatever to fix it.
- Filligree 3y agoSomehow this isn't a problem with Cargo.toml, however. What's cmake missing?
- humanrebar 3y agoCMake can detect when new source files are added and rerun itself. You need to know how to spell that option when globbing though.
- ndiddy 3y agoFrom the cmake documentation: > The CONFIGURE_DEPENDS flag may not work reliably on all generators, or if a new generator is added in the future that cannot support it, projects using it will be stuck. Even if CONFIGURE_DEPENDS works reliably, there is still a cost to perform the check on every rebuild.
- xboxnolifes 3y agoIs this much of a problem if you just assume the mentality of having to run cmake every time you pull code?