mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 23:30:35 +08:00
fix(build): restore smbus/smbus_sbs for Linux board targets
The previous commit (6b8fd11) gated smbus and smbus_sbs behind PX4_PLATFORM=="nuttx" to prevent clang-tidy errors on SITL, but these libraries depend on device::I2C which has a POSIX implementation (posix/I2C.cpp). Linux boards like bluerobotics_navigator (armhf) and emlid_navio2 (aarch64) enable CONFIG_DRIVERS_BATT_SMBUS, which depends on drivers__smbus — causing CMake to fail with "non-existent target". Move smbus and smbus_sbs back to unconditional add_subdirectory() so they are available on all platforms. Keep mcp_common gated behind NuttX since it includes px4_platform/gpio/mcp.hpp (NuttX-only GPIO headers). Re-add src/lib/drivers/smbus to the Makefile clang-tidy exclude list since the SITL compilation database lacks the I2C platform headers needed for analysis. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
@@ -38,8 +38,9 @@ add_subdirectory(led)
|
||||
add_subdirectory(magnetometer)
|
||||
add_subdirectory(rangefinder)
|
||||
|
||||
add_subdirectory(smbus)
|
||||
add_subdirectory(smbus_sbs)
|
||||
|
||||
if (${PX4_PLATFORM} STREQUAL "nuttx")
|
||||
add_subdirectory(mcp_common)
|
||||
add_subdirectory(smbus)
|
||||
add_subdirectory(smbus_sbs)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user