From 19af07e7ef5a8131835aa9f082c8d145a34a9221 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 6 Oct 2024 23:13:29 +0200 Subject: [PATCH] INSTALL-CMAKE.md: mention focus on shared libraries Match what the INSTALL.md document says for configure builds. Reported-by: Nemos2024 on github Fixes #14845 Closes #15168 --- docs/INSTALL-CMAKE.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index 0457efe2dc..4b9e16c706 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -107,6 +107,25 @@ Build (you have to specify the build directory). $ cmake --build ../curl-build +## Static builds + +The CMake build setup is primarily done to work with shared/dynamic third +party dependencies. When linking with shared libraries, the dependency "chain" +is handled automatically by the library loader - on all modern systems. + +If you instead link with a static library, you need to provide all the +dependency libraries already at the link command line. + +Figuring out all the dependency libraries for a given library is hard, as it +might involve figuring out the dependencies of the dependencies and they vary +between platforms and can change between versions. + +When using static dependencies, the build scripts mostly assume that you, the +user, provide all the necessary additional dependency libraries as additional +arguments in the build. + +Building statically is not for the faint of heart. + ### Fallback for CMake before version 3.13 CMake before version 3.13 does not support the `--build` option. In that