Skip to content

Commit

Permalink
Allow building without a python installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalbel committed Jan 10, 2022
1 parent d675c0c commit 2a81375
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ FOREACH(DIR ${ALLOW_LISTED})
ENDFOREACH()

add_library(${PROJECT_NAME} SHARED ${ALL_SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${TORCH_LIBRARIES} ${PNG_LIBRARY} ${JPEG_LIBRARIES} Python3::Python)
target_link_libraries(${PROJECT_NAME} PRIVATE ${TORCH_LIBRARIES} ${PNG_LIBRARY} ${JPEG_LIBRARIES})
set_target_properties(${PROJECT_NAME} PROPERTIES
EXPORT_NAME TorchVision
INSTALL_RPATH ${TORCH_INSTALL_PREFIX}/lib)
Expand Down
2 changes: 1 addition & 1 deletion torchvision/csrc/io/image/image.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "image.h"

#include <ATen/core/op_registration/op_registration.h>
#include <Python.h>
//#include <Python.h>

// If we are in a Windows environment, we need to define
// initialization functions for the _custom_ops extension
Expand Down
2 changes: 1 addition & 1 deletion torchvision/csrc/io/video_reader/video_reader.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "video_reader.h"

#include <Python.h>
//#include <Python.h>

#include "../decoder/memory_buffer.h"
#include "../decoder/sync_decoder.h"
Expand Down
2 changes: 1 addition & 1 deletion torchvision/csrc/vision.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "vision.h"

#ifndef MOBILE
#include <Python.h>
//#include <Python.h>
#endif
#include <torch/library.h>

Expand Down

0 comments on commit 2a81375

Please sign in to comment.