Miscellaneous changes to support in-tree builds.#185
Open
stellaraccident wants to merge 1 commit into
Open
Conversation
* Conditions find_package hsakmt on the pressence of the target. * Move finding of clang/llvm-objcopy to a common place and use an in-tree target if available. * Add options for depending on in-tree device libs. This is a roll-up of changes that I needed to do in order to build ROCR-Runtime with other parts of the toolkit. In my final arrangement, I am only using the first point, but I believe the second/third are general improvements -- so including those as well.
pfultz2
reviewed
Mar 12, 2024
| if(TARGET hsakmt::hsakmt) | ||
| message(STATUS "Using build dep on hsakmt") | ||
| else() | ||
| find_package(hsakmt 1.0 REQUIRED HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm) |
There was a problem hiding this comment.
The find_package should be disabled by the superproject either by using the OVERRIDE_FIND_PACKAGE in FetchContent_Declare or by using the register_source_package function as described here:
function(register_source_package NAME)
file(WRITE "${CMAKE_BINARY_DIR}/__pkg/${NAME}/${NAME}Config.cmake" "")
set(${NAME}_DIR ${CMAKE_BINARY_DIR}/__pkg/${NAME} CACHE PATH "")
endfunction()
pfultz2
reviewed
Mar 12, 2024
| pkg_check_modules(drm REQUIRED IMPORTED_TARGET libdrm) | ||
|
|
||
| ## Find dependencies that may be built with us or from an installed package. | ||
| if(TARGET hsakmt::hsakmt) |
There was a problem hiding this comment.
We should not be checking for if(TARGET) as this would require the superproject to order the add_subdirectory based on the dependency order. This can be quite fragile as we would need to change the order if the dependencies between components change. Instead we should just let cmake order the dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is a roll-up of changes that I needed to do in order to build ROCR-Runtime with other parts of the toolkit. In my final arrangement, I am only using the first point, but I believe the second/third are general improvements -- so including those as well.