[libclc] Add prepare-<triple> targets #146700
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This target provides a unified build target for all devices under the single triple. This way a user doesn't have to know device names to build a specific target's bytecode libraries.
Device names may be considered as internal implementation details as they are not exposed to users of CMake; users only specify triples to build. Now, instead of
prepare-{barts,cayman,cedar,cypress}-r600--.bc, for example, a user may now build simplyprepare-r600--and have all four of those libraries built.This commit also refactors the CMake somewhat. We were previously diverging between the SPIR-V and other targets, and duplicating a bit of logic like the creation of the 'prepare' targets, the targets' properties, and the installation directory. It's cleaner and hopefully more robust to share this code between all targets. This commit also takes this opportunity to improve some comments around this code.