karastojko / mailio

mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols. It is based on standard C++ 17 and Boost library.
Other
374 stars 98 forks source link

Executable on windows is large #92

Closed kjrmatt closed 2 years ago

kjrmatt commented 2 years ago

I built the source using MinGW and compiled some example codes in the "examples" folder. Everything works, although the executables are 12 MB -- this is large for an executable. I noticed that everything is built statically. I wonder if there is a way to link the dependencies dynamically?

karastojko commented 2 years ago

In the CMakeLists.txt instead of the line

add_library(${PROJECT_NAME} ${project_sources} ${project_headers})```

use

add_library(${PROJECT_NAME} SHARED ${project_sources} ${project_headers})

Then recompile everything and you should see the dynamic library.