@@ -997,11 +997,6 @@ elseif(USE_ROCM)
997
997
target_link_libraries (torch PUBLIC torch_hip_library)
998
998
endif ()
999
999
1000
- list (APPEND Caffe2_MAIN_LIBS torch_library)
1001
- if (USE_TBB)
1002
- list (APPEND Caffe2_MAIN_LIBS tbb)
1003
- endif ()
1004
-
1005
1000
# Install PDB files for MSVC builds
1006
1001
if (MSVC AND BUILD_SHARED_LIBS )
1007
1002
install (FILES $<TARGET_PDB_FILE:torch_cpu> DESTINATION "${TORCH_INSTALL_LIB_DIR} " OPTIONAL )
@@ -1102,7 +1097,7 @@ if(BUILD_TEST)
1102
1097
foreach (test_src ${Caffe2_CPU_TEST_SRCS} )
1103
1098
get_filename_component (test_name ${test_src} NAME_WE )
1104
1099
add_executable (${test_name} "${test_src} " )
1105
- target_link_libraries (${test_name} ${Caffe2_MAIN_LIBS} gtest_main)
1100
+ target_link_libraries (${test_name} torch_library gtest_main)
1106
1101
target_include_directories (${test_name} PRIVATE $<INSTALL_INTERFACE:include >)
1107
1102
target_include_directories (${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR} /include >)
1108
1103
target_include_directories (${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} )
@@ -1120,7 +1115,7 @@ if(BUILD_TEST)
1120
1115
foreach (test_src ${Caffe2_GPU_TEST_SRCS} )
1121
1116
get_filename_component (test_name ${test_src} NAME_WE )
1122
1117
cuda_add_executable(${test_name} "${test_src} " )
1123
- target_link_libraries (${test_name} ${Caffe2_MAIN_LIBS} gtest_main)
1118
+ target_link_libraries (${test_name} torch_library gtest_main)
1124
1119
target_include_directories (${test_name} PRIVATE $<INSTALL_INTERFACE:include >)
1125
1120
target_include_directories (${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} )
1126
1121
add_test (NAME ${test_name} COMMAND $<TARGET_FILE:${test_name} >)
@@ -1138,7 +1133,7 @@ if(BUILD_TEST)
1138
1133
foreach (test_src ${Caffe2_HIP_TEST_SRCS} )
1139
1134
get_filename_component (test_name ${test_src} NAME_WE )
1140
1135
add_executable (${test_name} "${test_src} " )
1141
- target_link_libraries (${test_name} ${Caffe2_MAIN_LIBS} gtest_main)
1136
+ target_link_libraries (${test_name} torch_library gtest_main)
1142
1137
target_include_directories (${test_name} PRIVATE $<INSTALL_INTERFACE:include >)
1143
1138
target_include_directories (${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE} )
1144
1139
target_compile_options (${test_name} PRIVATE ${HIP_CXX_FLAGS} )
@@ -1361,6 +1356,3 @@ if(BUILD_PYTHON)
1361
1356
install (DIRECTORY ${CMAKE_BINARY_DIR} /caffe2 DESTINATION ${PYTHON_LIB_REL_PATH}
1362
1357
FILES_MATCHING PATTERN "*.py" )
1363
1358
endif ()
1364
-
1365
- # Finally, set the Caffe2_MAIN_LIBS variable in the parent scope.
1366
- set (Caffe2_MAIN_LIBS ${Caffe2_MAIN_LIBS} PARENT_SCOPE)
0 commit comments