Skip to content

Conversation

@sarnex
Copy link
Contributor

@sarnex sarnex commented Aug 7, 2025

The problem was OpenCL_FOUND was getting set to TRUE on the second invocation of the module because find_package was finding the FetchContent clone in SOURCE_TREE/build/__deps.

We use OpenCL_FOUND to specifically refer to external system-wide installs, so use NO_CMAKE_PACKAGE_REGISTRY to make sure we don't find FetchContent clones.

Also not related to the fix here but re-order FetchContent_Declare FetchContent_GetProperties, the Declare should come first and we MakeAvailable should not be inside the if, we only check if it's populated to print the message.

Closes: #19737

@sarnex sarnex temporarily deployed to WindowsCILock August 7, 2025 16:04 — with GitHub Actions Inactive
@sarnex sarnex marked this pull request as ready for review August 7, 2025 16:21
@sarnex sarnex requested a review from a team as a code owner August 7, 2025 16:21
@sarnex
Copy link
Contributor Author

sarnex commented Aug 7, 2025

@igchor @pbalcer Do you guys mind reviewing this one? Fixes a really annoying CMake issue and I need to cherry pick this internally. Thanks!

@sarnex
Copy link
Contributor Author

sarnex commented Aug 7, 2025

Thanks Piotr!

@sarnex sarnex merged commit edb2472 into intel:sycl Aug 7, 2025
34 checks passed
ggojska pushed a commit to ggojska/llvm that referenced this pull request Aug 12, 2025
The problem was `OpenCL_FOUND` was getting set to `TRUE` on the second
invocation of the module because `find_package` was finding the
`FetchContent` clone in `SOURCE_TREE/build/__deps`.

We use `OpenCL_FOUND` to specifically refer to external system-wide
installs, so use `NO_CMAKE_PACKAGE_REGISTRY` to make sure we don't find
FetchContent clones.

Also not related to the fix here but re-order `FetchContent_Declare`
`FetchContent_GetProperties`, the `Declare` should come first and we
`MakeAvailable` should not be inside the `if`, we only check if it's
populated to print the message.

Closes: intel#19737

Signed-off-by: Sarnie, Nick <[email protected]>
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.

ninja: error: 'OpenCL::OpenCL', needed by 'lib/libur_adapter_opencl.so.0.12.0', missing and no known rule to make it

2 participants