The bela-config script is a CLI utility used to retrieve the necessary compiler flags, include paths, and linker settings required to build applications against the Bela platform. It is particularly useful for integrating Bela into C++ build systems (like Makefiles or CMake) when targeting Xenomai-enabled hardware.
Available flags:
--prefix: Returns the root directory of the Bela installation.--cflags / --cxxflags: Returns the optimized C/C++ compiler flags (e.g., architecture-specific tuning like armv7-a and neon).--ldflags: Returns the linker flags, including Xenomai POSIX skin configuration.--defines: Returns the required preprocessor definitions (e.g., -DXENOMAI_SKIN_posix).--includes: Returns the header search paths (Bela root and Bela include directories).--libraries: Returns the library search paths and the specific libraries to link against (-lbela, -lcobalt, etc.).
# Example: Getting all compiler flags
CXXFLAGS=$(bela-config --cxxflags)
# Example: Getting include paths
INCLUDES=$(bela-config --includes)
# Example: Getting linker flags and libraries
LDFLAGS=$(bela-config --ldflags)
LIBS=$(bela-config --libraries)