Closed jrn90 closed 2 years ago
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 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 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.
PX4 has a somewhat complex Makefile. There are a few things of note relating to building the firmware:
cmake-build
.cmake-build
function sets up the cmake args, build directory, determines whether to use Make or Ninja, sets up CMake cache, and builds the project (with Make or Ninja)cmake-build
function uses the cmake --build
function to call the appropriate build system.
We need to differentiate Make, Ninja, and CMake in PX4 in order to better understand the build system in place.
Acceptance Criteria