Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Oct 10, 2023
1 parent 6436ec2 commit 67f4540
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
8 changes: 4 additions & 4 deletions .ci/pnnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
# torchvision-version: 0.14.0
# torchvision-cache-key: '0_14_0'
#
# - torch-version: 2.0.0
# torchvision-version: 0.15.1
# torchvision-cache-key: '0_15_1'
#
- torch-version: 2.0.0
torchvision-version: 0.15.1
torchvision-cache-key: '0_15_1'

- torch-version: 2.1.0
torchvision-version: 0.16.0
torchvision-cache-key: '0_16_0'
Expand Down
29 changes: 1 addition & 28 deletions tools/pnnx/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -648,34 +648,7 @@ if(PROTOBUF_FOUND)
endif()

if(TorchVision_FOUND)
get_target_property(TorchVision_type TorchVision::TorchVision TYPE)
message(STATUS "TorchVision_type = ${TorchVision_type}")
if(TorchVision_type STREQUAL "SHARED_LIBRARY")
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
target_link_libraries(pnnx INTERFACE "-Wl,--no-as-needed,\"$<TARGET_FILE:TorchVision::TorchVision>\" -Wl,--as-needed")
else()
target_link_libraries(pnnx INTERFACE TorchVision::TorchVision)
endif()
target_link_libraries(pnnx INTERFACE $<TARGET_PROPERTY:TorchVision::TorchVision,INTERFACE_LINK_LIBRARIES>)
elseif(TorchVision_type STREQUAL "STATIC_LIBRARY")
if(APPLE)
target_link_libraries(pnnx INTERFACE -Wl,-force_load,\"$<TARGET_FILE:TorchVision::TorchVision>\")
elseif(MSVC)
target_link_libraries(pnnx INTERFACE "$<TARGET_FILE:TorchVision::TorchVision>")
target_link_options(pnnx INTERFACE "-WHOLEARCHIVE:$<TARGET_FILE:TorchVision::TorchVision>")
else()
target_link_libraries(pnnx INTERFACE "-Wl,--whole-archive,\"$<TARGET_FILE:TorchVision::TorchVision>\" -Wl,--no-whole-archive")
endif()
endif()

set_target_properties(pnnx PROPERTIES
INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:TorchVision::TorchVision,INTERFACE_COMPILE_DEFINITIONS>
INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:TorchVision::TorchVision,INTERFACE_COMPILE_OPTIONS>
INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:TorchVision::TorchVision,INTERFACE_INCLUDE_DIRECTORIES>
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:TorchVision::TorchVision,INTERFACE_SYSTEM_INCLUDE_DIRECTORIES>
)

#target_link_libraries(pnnx PRIVATE TorchVision::TorchVision)
target_link_libraries(pnnx PRIVATE TorchVision::TorchVision)
endif()

if(WIN32)
Expand Down

0 comments on commit 67f4540

Please sign in to comment.