Skip to content

Commit

Permalink
get imported location from hip
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Nov 5, 2022
1 parent 6c3a249 commit 2c9e4ac
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmake/information_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ macro(ginkgo_interface_libraries_recursively INTERFACE_LIBS)
filter_generator_expressions("${GINKGO_INTERFACE_LIBS_LINK_FLAGS}"
GINKGO_INTERFACE_LIB_NAME)
endif()
# Get the imported library
get_target_property(_libs_type "${_libs}" TYPE)
get_target_property(_libs_imported "${_libs}" IMPORTED)
if (_libs_imported AND NOT ${_libs_type} STREQUAL "INTERFACE_LIBRARY")
# only get the value from release for HIP related target
get_target_property(GINKGO_LIBS_IMPORTED_LIBS "${_libs}" IMPORTED_LOCATION_RELEASE)
if (GINKGO_LIBS_IMPORTED_LIBS)
list(APPEND GINKGO_INTERFACE_LIBS_FOUND "${GINKGO_LIBS_IMPORTED_LIBS}")
endif()
endif()
# Populate the include directories
get_target_property(GINKGO_LIBS_INTERFACE_INCS "${_libs}"
INTERFACE_INCLUDE_DIRECTORIES)
Expand Down Expand Up @@ -88,7 +98,6 @@ macro(ginkgo_interface_information)
# Call the recursive interface libraries macro
get_target_property(GINKGO_INTERFACE_LINK_LIBRARIES ginkgo INTERFACE_LINK_LIBRARIES)
ginkgo_interface_libraries_recursively("${GINKGO_INTERFACE_LINK_LIBRARIES}")

# Format and store the interface libraries found
# remove duplicates on the reversed list to keep the dependecy in the end of list.
list(REVERSE GINKGO_INTERFACE_LIBS_FOUND)
Expand Down

0 comments on commit 2c9e4ac

Please sign in to comment.