build(sim): convert PX4-OpticalFlow to git submodule (#27184)

Replace the ExternalProject_Add-based fetch of PX4/PX4-OpticalFlow with a
proper git submodule at src/modules/simulation/gz_plugins/optical_flow/PX4-OpticalFlow,
matching how every other external C++ dependency is integrated in PX4 (mavlink,
gps/devices, Micro-XRCE-DDS-Client, libevents, heatshrink, etc.).

The previous approach cloned the repo over the network on every clean build,
pinned to GIT_TAG master (unreproducible), and had generated a string of
follow-up PRs over the last year chasing ExternalProject quirks (install
paths, macOS .dylib vs .so, permissions).

The plugin now consumes the upstream OpticalFlow target directly via
add_subdirectory and px4_add_git_submodule. The upstream repo predates PX4's
strict warning policy, so the OpticalFlow and klt_feature_tracker targets get
-Wno-error plus a few specific -Wno-* flags and -fvisibility=default to build
cleanly inside the PX4 tree.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche
2026-04-23 12:57:02 -07:00
committed by GitHub
parent 4760327fa8
commit b911d4414e
4 changed files with 42 additions and 68 deletions
+3
View File
@@ -115,3 +115,6 @@
[submodule "libmodal-pipe"]
path = boards/modalai/voxl2/src/lib/mpa/libmodal-pipe
url = https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe.git
[submodule "src/modules/simulation/gz_plugins/optical_flow/PX4-OpticalFlow"]
path = src/modules/simulation/gz_plugins/optical_flow/PX4-OpticalFlow
url = https://github.com/PX4/PX4-OpticalFlow.git