Browse Source

fix pnnx windows build

tags/20240820
nihuini 2 years ago
parent
commit
802a625ae2
No known key found for this signature in database GPG Key ID: 98FD8F4EBC3E5DB8
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      tools/pnnx/src/CMakeLists.txt

+ 4
- 4
tools/pnnx/src/CMakeLists.txt View File

@@ -601,6 +601,10 @@ add_library(torch2pnnx OBJECT ${torch2pnnx_SRCS})
target_compile_definitions(torch2pnnx PRIVATE BUILD_TORCH2PNNX)
target_compile_options(torch2pnnx PUBLIC "${TORCH_CXX_FLAGS}")

if(WIN32)
target_compile_definitions(torch2pnnx PUBLIC NOMINMAX)
endif()

if(TorchVision_FOUND)
set_property(SOURCE load_torchscript.cpp APPEND PROPERTY COMPILE_DEFINITIONS PNNX_TORCHVISION)
endif()
@@ -713,10 +717,6 @@ if(PNNX_COVERAGE)
target_link_libraries(pnnx PUBLIC -coverage -lgcov)
endif()

if(WIN32)
target_compile_definitions(pnnx PUBLIC NOMINMAX)
endif()

# set_target_properties(pnnx PROPERTIES COMPILE_FLAGS -fsanitize=address)
# set_target_properties(pnnx PROPERTIES LINK_FLAGS -fsanitize=address)



Loading…
Cancel
Save