Figured it out. Per this Kratos guide, add this compiler option:
-- -DCMAKE_EXPORT_COMPILE_COMMANDS=ON