Overview

Note: The decision to switch from GNU Make to CMake is highly controversial. Many people are wildly in favor and a large number are strong opposed. This is a change that must be brought before the PMC for a vote before any action is taken.

CMake vs GNU Make IMPACT

  1. Introduces additional build dependency (with frequent updates) to the project.
    1. Self-compatibility and enforced-changes risks with frequent updates while GNU Make is already rock solid stable.
  2. Two alternate overlapping build systems:
    1. Heavy initial burden of work.
    2. Doubled effort in maintaining two parallel build systems.
    3. High risk of Inconsistencies and self-incompatibilities in transition period.
  3. CI and Build automation tools must be re-written from scratch everywhere:
    1. NuttX project internals.
    2. users.
    3. customers.
    4. companies.
    5. documentation.

CMake vs GNU Make PROS (in favor)

  1. Better Integration with modern Continuous Integration automation and build systems:
    1. Better CI maintenance with cmake.
      1. CI admin needs to use "hacks" to operate GitHub CI with GNU Make.
      2. cmake is better aligned with GitHub CI framework.
    2. Improved PR processing:
      1. Reliable automated testing of each provided PR on GitHub when using cmake.
    3. Improved Build Efficiency:
      1. Build times better with CMake than GNU Make.
        1. TODO: We need a proof for that, some sort of comparison table + chart with real world data.
    4. Allows building various configurations in sub-directory of a single source tree.
      1. shorter fetch related time.
      2. leverages parallelism for several builds at the same time.
  2. Clean code:
    1. Everything is way more readable then the current Make files.
    2. Easier on-boarding.

      1. new users may be more familiar with CMake.
      2. easier initial configuration process.
    3. Less build-related bugs.

      1. TODO: explanation needed.
    4. Less boiler-plate code.

      1. TODO: explanation needed.
  3. Better efficiency:
    1. people often refer that CMake build is faster than GNU Make:
      1. TODO: Provide real world in-NuttX measurements comparison.
    2. CMake can generate build configuration files for various build mechanisms (i.e. GNU Make, ninja, etc).
  4. Great Integration with modern IDE:
    1. TODO: details required here.
  5. Good well proven portability.
  6. Can act initially as separate build system aside and with no conflict to current GNU Make.
  7. "Modern".
    1. TODO: details required here.

CMake vs GNU Make CONS (against)

  1. CMake is less flexible than GNU Make.
  2. GNU Make is small and efficient (i.e. builds firmware in ~20 seconds). "If it is not broken, don't fix".
  3. Introduces additional build dependency to the project.
  4. Self-compatibility and enforced-changes risks with frequent updates while GNU Make is already rock solid stable.
  5. Two alternate overlapping build systems:
    1. Heavy initial burden of work.
    2. Doubled effort in maintaining two parallel build systems.
    3. High risk of Inconsistencies and self-incompatibilities in transition period.
  6. Additional work:
    1. CI and Build automation tools must be re-written from scratch everywhere:
      1. project itself.
      2. users.
      3. customers.
      4. companies.
      5. documentation.

References

  1. https://cmake.org/overview/
  2. https://www.gnu.org/software/make/
  3. Trilinos CMake Evaluation (https://www.sandia.gov/app/uploads/sites/143/2021/10/daniel-dunlavy-2008-SAND2008-7593.pdf).
  4. A Build System for Benchmarking and Comparison of Competing System Implementations, Anthony J. Bentley, University of New Mexico (https://digitalrepository.unm.edu/ece_etds/298/).

  5. https://earthly.dev/blog/cmake-vs-make-diff/
  6. https://www.g2.com/compare/cmake-vs-gnu-make
  7. https://www.incredibuild.com/blog/cmake-vs-make