Skip to content

Commit 582aefa

Browse files
Ilia Cherniavskiifacebook-github-bot
authored andcommitted
Kineto cmake fix (#216)
Summary: Pull Request resolved: #216 Check the variable value before adding dep on cupti Reviewed By: gdankel, malfet Differential Revision: D28363222 fbshipit-source-id: 09f7da1e756ee35559e79ec7a2e5018223f5a12f
1 parent 1e9a1a9 commit 582aefa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libkineto/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ endif()
4242

4343
# Set LIBKINETO_NOCUPTI to explicitly disable CUPTI
4444
# Otherwise, CUPTI is disabled if not found
45-
IF (NOT CUDA_SOURCE_DIR AND NOT CUPTI_INCLUDE_DIR)
45+
IF (NOT CUDA_SOURCE_DIR OR NOT CUPTI_INCLUDE_DIR OR NOT CUDA_cupti_LIBRARY)
4646
set(LIBKINETO_NOCUPTI ON CACHE BOOL "" FORCE)
4747
endif()
4848

@@ -144,7 +144,9 @@ else()
144144
message(FATAL_ERROR "Unsupported library type ${KINETO_LIBRARY_TYPE}")
145145
endif()
146146

147-
target_link_libraries(kineto "${CUDA_cupti_LIBRARY}")
147+
if(NOT LIBKINETO_NOCUPTI)
148+
target_link_libraries(kineto "${CUDA_cupti_LIBRARY}")
149+
endif()
148150
target_link_libraries(kineto $<BUILD_INTERFACE:fmt::fmt-header-only>)
149151
add_dependencies(kineto fmt::fmt-header-only)
150152

0 commit comments

Comments
 (0)