Append c10 libs to TorchConfig.cmake (#18418)

Summary:
Fixes #18416.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18418

Differential Revision: D14635322

Pulled By: ezyang

fbshipit-source-id: 81cb658f73583e4cd0358173617f747ebf4f7f8a
This commit is contained in:
peterjc123
2019-03-26 19:47:37 -07:00
committed by Facebook Github Bot
parent 2ba41c5550
commit d5861aa55c

View File

@ -44,6 +44,9 @@ find_library(TORCH_LIBRARY torch PATHS "${TORCH_INSTALL_PREFIX}/lib")
add_library(torch UNKNOWN IMPORTED)
set(TORCH_LIBRARIES torch ${Caffe2_MAIN_LIBS})
find_library(C10_LIBRARY c10 PATHS "${TORCH_INSTALL_PREFIX}/lib")
list(APPEND TORCH_LIBRARIES ${C10_LIBRARY})
if (@USE_CUDA@)
if(MSVC)
set(NVTOOLEXT_HOME "C:/Program Files/NVIDIA Corporation/NvToolsExt")
@ -68,6 +71,8 @@ if (@USE_CUDA@)
${LIBNVTOOLSEXT}
${CUDA_LIBRARIES})
endif()
find_library(C10_CUDA_LIBRARY c10_cuda PATHS "${TORCH_INSTALL_PREFIX}/lib")
list(APPEND TORCH_CUDA_LIBRARIES ${C10_CUDA_LIBRARY})
list(APPEND TORCH_LIBRARIES ${TORCH_CUDA_LIBRARIES})
endif()