Skip to content

Commit dc91816

Browse files
malfetfacebook-github-bot
authored andcommitted
Remove Caffe2_MAIN_LIBS (pytorch#38408)
Summary: Right now it is an unused alias to `torch_library` interface library Pull Request resolved: pytorch#38408 Differential Revision: D21598250 Pulled By: malfet fbshipit-source-id: ec9a2446b94e7ea68298831212005c2c80bbc95c
1 parent daa85cf commit dc91816

File tree

5 files changed

+6
-18
lines changed

5 files changed

+6
-18
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.10)
2020
endif()
2121

2222
# ---[ Project and semantic versioning.
23-
project(Caffe2 CXX C)
23+
project(Torch CXX C)
2424

2525
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
2626
set(LINUX TRUE)

caffe2/CMakeLists.txt

+3-11
Original file line numberDiff line numberDiff line change
@@ -997,11 +997,6 @@ elseif(USE_ROCM)
997997
target_link_libraries(torch PUBLIC torch_hip_library)
998998
endif()
999999

1000-
list(APPEND Caffe2_MAIN_LIBS torch_library)
1001-
if(USE_TBB)
1002-
list(APPEND Caffe2_MAIN_LIBS tbb)
1003-
endif()
1004-
10051000
# Install PDB files for MSVC builds
10061001
if(MSVC AND BUILD_SHARED_LIBS)
10071002
install(FILES $<TARGET_PDB_FILE:torch_cpu> DESTINATION "${TORCH_INSTALL_LIB_DIR}" OPTIONAL)
@@ -1102,7 +1097,7 @@ if(BUILD_TEST)
11021097
foreach(test_src ${Caffe2_CPU_TEST_SRCS})
11031098
get_filename_component(test_name ${test_src} NAME_WE)
11041099
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)
11061101
target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
11071102
target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
11081103
target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
@@ -1120,7 +1115,7 @@ if(BUILD_TEST)
11201115
foreach(test_src ${Caffe2_GPU_TEST_SRCS})
11211116
get_filename_component(test_name ${test_src} NAME_WE)
11221117
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)
11241119
target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
11251120
target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
11261121
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
@@ -1138,7 +1133,7 @@ if(BUILD_TEST)
11381133
foreach(test_src ${Caffe2_HIP_TEST_SRCS})
11391134
get_filename_component(test_name ${test_src} NAME_WE)
11401135
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)
11421137
target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
11431138
target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
11441139
target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
@@ -1361,6 +1356,3 @@ if(BUILD_PYTHON)
13611356
install(DIRECTORY ${CMAKE_BINARY_DIR}/caffe2 DESTINATION ${PYTHON_LIB_REL_PATH}
13621357
FILES_MATCHING PATTERN "*.py")
13631358
endif()
1364-
1365-
# Finally, set the Caffe2_MAIN_LIBS variable in the parent scope.
1366-
set(Caffe2_MAIN_LIBS ${Caffe2_MAIN_LIBS} PARENT_SCOPE)

cmake/BuildVariables.cmake

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ set(Caffe2_GPU_TEST_SRCS)
2222
set(Caffe2_CPU_INCLUDE)
2323
set(Caffe2_GPU_INCLUDE)
2424

25-
# Caffe2_MAIN_LIBS is a list of the libraries that a dependent library should
26-
# depend on when it links against Caffe2.
27-
set(Caffe2_MAIN_LIBS)
28-
2925
# Lists for Caffe2 dependency libraries, for CPU and CUDA respectively.
3026
set(Caffe2_DEPENDENCY_LIBS "")
3127
set(Caffe2_CUDA_DEPENDENCY_LIBS "")

cmake/public/utils.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function(caffe2_binary_target target_name_or_src)
128128
prepend(__srcs "${CMAKE_CURRENT_SOURCE_DIR}/" "${target_name_or_src}")
129129
endif()
130130
add_executable(${__target} ${__srcs})
131-
target_link_libraries(${__target} ${Caffe2_MAIN_LIBS})
131+
target_link_libraries(${__target} torch_library)
132132
# If we have Caffe2_MODULES defined, we will also link with the modules.
133133
if(DEFINED Caffe2_MODULES)
134134
target_link_libraries(${__target} ${Caffe2_MODULES})

modules/rocksdb/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ target_link_libraries(caffe2_rocksdb PRIVATE ${RocksDB_LIBRARIES})
6161
target_include_directories(caffe2_rocksdb PRIVATE ${RocksDB_INCLUDE_DIR})
6262
install(TARGETS caffe2_rocksdb DESTINATION lib)
6363

64-
# ---[ Last, Append the library to Caffe2_MAIN_LIBS, if we are building with
64+
# ---[ Last, Append the library to Caffe2_MODULES, if we are building with
6565
# the main repo.
6666
# The purpose of this is that, for all binaries built in the Caffe2 main repo,
6767
# they will be built with the first class modules that are built. As a result,

0 commit comments

Comments
 (0)