render-se / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

In terms of building firmware, what is Make's, Ninja's, and CMake's responsibility? #16

Closed jrn90 closed 2 years ago

jrn90 commented 2 years ago

We need to differentiate Make, Ninja, and CMake in PX4 in order to better understand the build system in place.

Acceptance Criteria

jrn90 commented 2 years ago

Ninja

Ninja is used as the primary, and preferred, build system for PX4. It's primary focus is speed. The Ninja build files are generated using CMake Generators. You can see the generated files in builds under *.ninja.

Make

Make is used as another build system for PX4. Make is the default build system for CMake. It can be used to build PX4 but Ninja is the primary build system for PX4.

CMake

CMake is a generator of build systems. It is used in PX4 to generate Make & Ninja build files. It is useful for PX4 since it creates cross-platform builds out of the same CMakeLists.txt file which allows PX4 to compile on Windows, Mac, and Linux.

Under the hood Make & Ninja use the GCC compiler to compile PX4.

Makefile

PX4 has a somewhat complex Makefile. There are a few things of note relating to building the firmware:

jrn90 commented 2 years ago

Captured in wiki.