杂项

  • window 下查看 lib 的运行库类型:
>  dumpbin /directives xxx.lib
    /DEFAULTLIB:msvcprt  : md
    /DEFAULTLIB:LIBCMT : mt

cmake

  • 常用设置:
// 放在 project(projectName LANGUAGES CXX) 前
SET(CMAKE_SYSTEM_PROCESSOR x64)
SET(CMAKE_C_COMPILER "C:/Program Files/LLVM/bin/clang-cl.exe")
SET(CMAKE_CXX_COMPILER  "C:/Program Files/LLVM/bin/clang-cl.exe")
SET(CMAKE_BUILD_TYPE  Release)

Win10 + x86 下 ncnn 编译 mt 版本

cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=ON ../cmake

cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DNCNN_BUILD_WITH_STATIC_CRT=ON -DCMAKE_INSTALL_PREFIX=%cd%/install -DProtobuf_INCLUDE_DIR=C:/protoc/install_x86_mt/include -DProtobuf_LIBRARIES=C:/protoc/install_x86_mt/lib/libprotobuf.lib -DProtobuf_PROTOC_EXECUTABLE=C:/protoc/install_x86_mt/bin/protoc.exe -DNCNN_VULKAN=OFF ..

你可能感兴趣的:(杂项)