前言
去除非必要库缩减体积
环境
strawberry-perl-5.32.1.1-64bit
strawberry-perl
安装完成后都添加到环境变量
Visual Studio 2015
Openssl 1.1.1
过程:
开始 — 所有程序 — Visual Studio 2019 — Visual Studio Tools — 选择一个命令提示工具
进入命令提示符,然后定位至OpenSSL的安装目录
cd 到openssl目录下,使用命令:
perl Configure VC-WIN32 no-asm no-async no-shared no-md2 no-md4 no-mdc2 no-poly1305 no-blake2 no-siphash no-sm3 no-rc2 no-rc4 no-rc5 no-idea no-aria no-bf no-cast no-camellia no-seed no-sm4 no-chacha no-ec no-dsa no-sm2 no-dso no-engine no-err no-comp no-ocsp no-cms no-ts no-srp no-cmac no-ct --prefix=C:\Users\xx\Desktop\openssl
这是看你自己选择缩减什么库
参数参考:
https://wiki.openssl.org/index.php/Compilation_and_Installation
no-shared为静态库,反之为动态库
VC-WIN32 为32库
VC-WIN64A 为64库
要使用debug版本,请使用debug-VC-WIN64A或debug-VC-WIN32
–prefix为编译完成后的输出路径
nmake
编译
nmake test
编译
nmake install
编译 输出
nmake clean
清除编译的openssl
参考文章:
https://developer.aliyun.com/article/717370
https://breezetemple.github.io/2019/04/03/cros-compile-openssl-and-wolfssl/
https://www.jianshu.com/p/f510823735fc