Skip to content

[libclc] Fix cross in-tree builds #97392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 2, 2024
Merged

Conversation

hvdijk
Copy link
Contributor

@hvdijk hvdijk commented Jul 2, 2024

When performing cross in-tree builds, we need native versions of various tools, we cannot assume the cross builds that are part of the current build are executable. LLVM provides the setup_host_tool function to handle this, either picking up versions of tools from LLVM_NATIVE_TOOL_DIR, or implicitly building native versions as needed. Use it for libclc too.

LLVM's setup_host_tool function assumes the project is LLVM, so this also needs libclc's project() to be conditional on it being built standalone. Luckily, the only change this needs is using CMAKE_CURRENT_SOURCE_DIR instead of PROJECT_SOURCE_DIR.

hvdijk added 2 commits June 28, 2024 13:41
This is NFC at the moment because nothing relies on ${PROJECT_*} being
set to the LLVM values.
When performing cross in-tree builds, we need native versions of various
tools, we cannot assume the cross builds that are part of the current
build are executable. LLVM provides the setup_host_tool macro to handle
this, either picking up versions of tools from LLVM_NATIVE_TOOL_DIR, or
implicitly building native versions as needed. Use it for libclc too.
@hvdijk hvdijk added the libclc libclc OpenCL library label Jul 2, 2024
@hvdijk hvdijk requested a review from tstellar July 2, 2024 08:39
@hvdijk hvdijk merged commit 5ee53d4 into llvm:main Jul 2, 2024
9 checks passed
@hvdijk hvdijk deleted the fix-libclc-cross-builds branch July 2, 2024 15:27
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
When performing cross in-tree builds, we need native versions of various
tools, we cannot assume the cross builds that are part of the current
build are executable. LLVM provides the setup_host_tool function to
handle this, either picking up versions of tools from
LLVM_NATIVE_TOOL_DIR, or implicitly building native versions as needed.
Use it for libclc too.

LLVM's setup_host_tool function assumes the project is LLVM, so this
also needs libclc's project() to be conditional on it being built
standalone. Luckily, the only change this needs is using
CMAKE_CURRENT_SOURCE_DIR instead of PROJECT_SOURCE_DIR.
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
When performing cross in-tree builds, we need native versions of various
tools, we cannot assume the cross builds that are part of the current
build are executable. LLVM provides the setup_host_tool function to
handle this, either picking up versions of tools from
LLVM_NATIVE_TOOL_DIR, or implicitly building native versions as needed.
Use it for libclc too.

LLVM's setup_host_tool function assumes the project is LLVM, so this
also needs libclc's project() to be conditional on it being built
standalone. Luckily, the only change this needs is using
CMAKE_CURRENT_SOURCE_DIR instead of PROJECT_SOURCE_DIR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libclc libclc OpenCL library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants