Skip to content

fix: skip yuv2rgb.cu compilation in CPU-only builds - #15811

Open
lilejin322 wants to merge 1 commit into
ApolloAuto:masterfrom
lilejin322:r11.0.1
Open

fix: skip yuv2rgb.cu compilation in CPU-only builds#15811
lilejin322 wants to merge 1 commit into
ApolloAuto:masterfrom
lilejin322:r11.0.1

Conversation

@lilejin322

Copy link
Copy Markdown

modules/drivers/camera/format:convert is a cuda_library, but its generated :install target is unconditionally pulled in by //modules/drivers/camera's own :install aggregation (apollo_package() adds a hard dependency on every subpackage's :install, regardless of platform). This forces yuv2rgb.cu to be compiled even for bash apollo.sh build_cpu, where it fails because gcc doesn't recognize .cu files without the CUDA toolchain.

Gate the .cu source with if_cuda() so the library degrades to an empty target when CUDA isn't configured, instead of failing to compile.

modules/drivers/camera/format:convert is a cuda_library, but its
generated `:install` target is unconditionally pulled in by
//modules/drivers/camera's own `:install` aggregation (apollo_package()
adds a hard dependency on every subpackage's `:install`, regardless of
platform). This forces yuv2rgb.cu to be compiled even for
`bash apollo.sh build_cpu`, where it fails because gcc doesn't
recognize .cu files without the CUDA toolchain.

Gate the .cu source with if_cuda() so the library degrades to an empty
target when CUDA isn't configured, instead of failing to compile.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Jul 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants