curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Update: Minimal libcurl compile for Windows; Missing flags?

From: Testing WunTuTri via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 8 May 2020 00:41:49 +0000

old thread: https://curl.haxx.se/mail/lib-2020-05/0021.html

Hey folks,

So I decided to fully commit to the Microsoft compiler, and figure out the
flags on the go which disable features I don't need. (99% of them basically)

My steps so far:
(inside the x64 native tools console on windows)
winbuild dir:
1.
SET CC=cl /DHTTP_ONLY /DCURL_DISABLE_COOKIES /DCURL_DISABLE_CRYPTO_AUTH
/DCURL_DISABLE_VERBOSE_STRINGS /DCURL_DISABLE_DICT /DCURL_DISABLE_FILE
/DCURL_DISABLE_MIME /DCURL_DISABLE_HTTP_AUTH /DCURL_DISABLE_PARSEDATE
/DCURL_DISABLE_DOH /DCURL_DISABLE_SHUFFLE_DNS /DCURL_DISABLE_PROGRESS_METER
/DCURL_DISABLE_LIBCURL_OPTION /DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
/DCURL_DISABLE_NETRC

2.
nmake /f Makefile.vc mode=static ENABLE_SSPI=no ENABLE_IPV6=no
ENABLE_IDN=no ENABLE_WINSSL=no GEN_PDB=no DEBUG=no MACHINE=x64

This yields libcurl_a.lib which is 718kb in size(2x smaller than the
default compile), WHICH ALSO WORKS for my project!! Thanks to Ray Satiro

I've tried grep searches on the root curl-7.70.0 folder;

grep -r -i "CURL_DISABLE_" .

But I haven't found anything that I already haven't used. Since
documentation says I can make my lib as small as 90kb I guess I'm still
missing something.
This can also be seen by comparing MINGW additional .configure flags to the
MSVC flags, which I haven't found

./configure --disable-ares --disable-ipv6 --disable-manual
--disable-verbose --disable-versioned-symbols --enable-symbol-hiding
--without-libidn --without-librtmp --without-ssl --without-zlib
--without-libidn2 --disable-pthreads --without-libmetalink
--disable-unix-sockets --without-strerror --disable-warnings

So my question would be, do you fine folks know if there are any more MSVC
flags I could use to make the static library even smaller?

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-05-08