Browse Source

link pnnx with pthread, fix minmax issue on windows build

tags/20220420
nihui 4 years ago
parent
commit
0d83ad99f8
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      tools/pnnx/src/CMakeLists.txt
  2. +1
    -0
      tools/pnnx/src/main.cpp

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

@@ -463,7 +463,7 @@ endif()
if(WIN32)
target_link_libraries(pnnx PRIVATE ${TORCH_LIBRARIES})
else()
target_link_libraries(pnnx PRIVATE ${TORCH_LIBRARIES} dl)
target_link_libraries(pnnx PRIVATE ${TORCH_LIBRARIES} pthread dl)
endif()

#set_target_properties(pnnx PROPERTIES COMPILE_FLAGS -fsanitize=address)


+ 1
- 0
tools/pnnx/src/main.cpp View File

@@ -16,6 +16,7 @@

#if _WIN32
#include <windows.h>
#include <c10/util/win32-headers.h>
#else
#include <dlfcn.h>
#endif


Loading…
Cancel
Save