Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions share/rocm/cmake/ROCMInstallTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ function(rocm_install)
if(ARGV0 STREQUAL "TARGETS")
# rocm_install_targets deals with the component in its own fashion.
rocm_install_targets("${ARGN}")
elseif(ENABLE_ASAN_PACKAGING)
set(oneValueArgs ASAN_DESTINATION DESTINATION COMPONENT)
cmake_parse_arguments(PARSE "" "${oneValueArgs}" "" ${ARGN})
if(DEFINED PARSE_ASAN_DESTINATION)
install(
${PARSE_UNPARSED_ARGUMENTS}
DESTINATION ${PARSE_ASAN_DESTINATION}
COMPONENT runtime
)
endif()
elseif(NOT ROCM_USE_DEV_COMPONENT)
# If we want legacy behaviour, directly call install with no meddling.
install(${ARGN})
Expand Down Expand Up @@ -119,7 +129,7 @@ endfunction()
option(ROCM_SYMLINK_LIBS "Create backwards compatibility symlink for library files." ON)

function(rocm_install_targets)
set(options)
set(options PRIVATE)
set(oneValueArgs PREFIX EXPORT COMPONENT)
set(multiValueArgs TARGETS INCLUDE)

Expand All @@ -137,7 +147,7 @@ function(rocm_install_targets)
set(LIB_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR})
set(INCLUDE_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
elseif(ENABLE_ASAN_PACKAGING)
set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}/asan)
set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
else()
Expand All @@ -146,6 +156,11 @@ function(rocm_install_targets)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
endif()

if (PARSE_PRIVATE)
set(BIN_INSTALL_DIR ${BIN_INSTALL_DIR}/${PROJECT_NAME})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ${LIB_INSTALL_DIR}/${PROJECT_NAME}.

set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR}/${PROJECT_NAME})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be ${LIB_INSTALL_DIR}/${PROJECT_NAME}/lib. Also, we should probably do this for include as well.

endif()

foreach(TARGET ${PARSE_TARGETS})
foreach(INCLUDE ${PARSE_INCLUDE})
get_filename_component(INCLUDE_PATH ${INCLUDE} ABSOLUTE)
Expand Down