janbar / openssl-cmake

Build OpenSSL with CMake on MacOS, Win32, Win64 and cross compile for Android, IOS
Other
277 stars 144 forks source link

Update CMakeLists.txt #17

Open Nemirtingas opened 4 years ago

Nemirtingas commented 4 years ago

Fixes #16

janbar commented 2 years ago

crypto is not linked with these libs. Probably your parent project is.

Nemirtingas commented 2 years ago

I don't even know what you are talking about. crypto is the name of the library currently being built in your cmake file: https://github.com/janbar/openssl-cmake/blob/master/crypto/CMakeLists.txt#L286

I added user32 advapi32 because thoses are default libraries added by CMake that can be disabled, thats why I had to add them manually.

janbar commented 2 years ago

I haven't skills with windows platform. So what could disable those default link ?

Nemirtingas commented 2 years ago

When you want to remove unecessary dependencies linked to you library/exec. CMake uses theses libraries as default linked libraries:

-- CMAKE_CXX_STANDARD_LIBRARIES_INIT=-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames
-- CMAKE_C_STANDARD_LIBRARIES_INIT=-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames

I have a toolchain that cross-compiles on Linux for Windows using the MSVC standard library, not mingw. It also allows me to link against use the newer libraries mincore.lib and WindowsApp.lib that are used for UWP apps. mincore and WindowsApp link to the new versionned interfaces like

api-ms-win-core-file-l1-1-0.dll
api-ms-win-core-handle-l1-1-0.dll
api-ms-win-core-errorhandling-l1-1-0.dll
api-ms-win-core-heap-l1-1-0.dll
api-ms-win-core-io-l1-1-0.dll
api-ms-win-core-synch-l1-1-0.dll