Skip to content
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

[XPU] fix cmake can't find pti_view on Windows. #1012

Closed
wants to merge 4 commits into from
Closed
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
12 changes: 11 additions & 1 deletion libkineto/src/plugin/xpupti/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@ find_package(Pti REQUIRED)
if(TARGET Pti::pti_view)
message(INFO " Found XPUPTI")

set(pti_view_names)
# For Linux, due to it has soft link original file name is fine.
list(APPEND pti_view_names pti_view)
# For Windows, file name to be appended with version number.
foreach(ver_major RANGE 0 1)
foreach(ver_minor RANGE 0 19)
list(APPEND pti_view_names pti_view-${ver_major}-${ver_minor})
endforeach()
endforeach()

get_target_property(PTI_INCLUDE_DIR Pti::pti_view INTERFACE_INCLUDE_DIRECTORIES)
find_library(PTI_VIEW_LIBRARY NAMES pti_view PATHS "${PTI_INCLUDE_DIR}/../lib")
find_library(PTI_VIEW_LIBRARY NAMES ${pti_view_names} PATHS "${PTI_INCLUDE_DIR}/../lib")
set(PTI_LIBRARY ${PTI_VIEW_LIBRARY} CACHE STRING "Imported PTI library.")
set(PTI_INCLUDE_DIR ${PTI_INCLUDE_DIR} CACHE STRING "PTI include directory.")

Expand Down
Loading