mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Summary:
Running commands:
```bash
shopt -s globstar
sed -e 's/IF (/if(/g' -e 's/IF(/if(/g' -e 's/if (/if(/g' -e 's/ELSE (/else(/g' -e 's/ELSE(/else(/g' -e 's/else (/else(/g' -e 's/ENDif(/endif(/g' -e 's/ELSEif(/elseif(/g' -i CMakeLists.txt
sed -e 's/IF (/if(/g' -e 's/IF(/if(/g' -e 's/if (/if(/g' -e 's/ELSE (/else(/g' -e 's/ELSE(/else(/g' -e 's/else (/else(/g' -e 's/ENDif(/endif(/g' -e 's/ELSEif(/elseif(/g' -i caffe2/**/CMakeLists.txt
sed -e 's/IF (/if(/g' -e 's/IF(/if(/g' -e 's/if (/if(/g' -e 's/ELSE (/else(/g' -e 's/ELSE(/else(/g' -e 's/else (/else(/g' -e 's/ENDif(/endif(/g' -e 's/ELSEif(/elseif(/g' -i torch/**/CMakeLists.txt
sed -e 's/IF (/if(/g' -e 's/IF(/if(/g' -e 's/if (/if(/g' -e 's/ELSE (/else(/g' -e 's/ELSE(/else(/g' -e 's/else (/else(/g' -e 's/ENDif(/endif(/g' -e 's/ELSEif(/elseif(/g' -i c10/**/CMakeLists.txt
sed -e 's/IF (/if(/g' -e 's/IF(/if(/g' -e 's/if (/if(/g' -e 's/ELSE (/else(/g' -e 's/ELSE(/else(/g' -e 's/else (/else(/g' -e 's/ENDif(/endif(/g' -e 's/ELSEif(/elseif(/g' -i cmake/**/*.cmake
sed -e 's/IF (/if(/g' -e 's/IF(/if(/g' -e 's/if (/if(/g' -e 's/ELSE (/else(/g' -e 's/ELSE(/else(/g' -e 's/else (/else(/g' -e 's/ENDif(/endif(/g' -e 's/ELSEif(/elseif(/g' -i cmake/**/*.cmake.in
```
We may further convert all the commands into lowercase according to the following issue: 77543bde41
.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35521
Differential Revision: D20704382
Pulled By: malfet
fbshipit-source-id: 42186b9b1660c34428ab7ceb8d3f7a0ced5d2e80
29 lines
903 B
CMake
29 lines
903 B
CMake
if(NOT LIBSHM_INSTALL_LIB_SUBDIR)
|
|
SET(LIBSHM_INSTALL_BIN_SUBDIR "bin" CACHE PATH "libshm install binary directory")
|
|
SET(LIBSHM_INSTALL_LIB_SUBDIR "lib" CACHE PATH "libshm install library directory")
|
|
endif()
|
|
|
|
ADD_LIBRARY(shm SHARED core.cpp)
|
|
|
|
TARGET_COMPILE_DEFINITIONS(shm PRIVATE
|
|
"_CRT_SECURE_NO_DEPRECATE=1"
|
|
"SHM_EXPORTS"
|
|
)
|
|
|
|
target_include_directories(shm PRIVATE
|
|
${CMAKE_BINARY_DIR}/aten/src # provides "ATen/TypeExtendedInterface.h" to ATen.h
|
|
${TORCH_ROOT}/torch/lib # provides "libshm/libshm.h"
|
|
${CMAKE_BINARY_DIR}/caffe2/aten/src # provides <TH/THGeneral.h> to THC.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
)
|
|
|
|
TARGET_LINK_LIBRARIES(shm torch c10)
|
|
|
|
|
|
INSTALL(TARGETS shm DESTINATION "${LIBSHM_INSTALL_LIB_SUBDIR}")
|
|
INSTALL(FILES libshm.h DESTINATION "include")
|
|
|
|
if(MSVC AND BUILD_SHARED_LIBS)
|
|
INSTALL(FILES $<TARGET_PDB_FILE:shm> DESTINATION "${LIBSHM_INSTALL_LIB_SUBDIR}" OPTIONAL)
|
|
endif()
|