Skip to content

Commit 4f36b55

Browse files
committed
Fix Windows builds
Signed-off-by: cyy <[email protected]>
1 parent 415c8fc commit 4f36b55

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

libkineto/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ if(NOT LIBKINETO_NOCUPTI)
7171
NO_DEFAULT_PATH)
7272
endif()
7373

74+
if(NOT USE_CUPTI_SO AND NOT CUDA_cupti_static_LIBRARY)
75+
find_library(CUDA_cupti_static_LIBRARY cupti_static PATHS ${CUDA_PATHS}
76+
NO_DEFAULT_PATH)
77+
endif()
78+
endif()
79+
if(NOT CUDA_cupti_static_LIBRARY)
80+
if(WIN32)
81+
message(WARNING "CUPTI is not static on Windows, switch to shared library")
82+
set(USE_CUPTI_SO OFF)
83+
else()
84+
set(cupti_LIBRARY ${CUDA_cupti_static_LIBRARY})
85+
endif()
86+
7487
if(USE_CUPTI_SO)
7588
if(NOT CUDA_cupti_LIBRARY)
7689
find_library(CUDA_cupti_LIBRARY cupti PATHS ${CUDA_PATHS}

0 commit comments

Comments
 (0)