aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-01-10 19:02:12 -0600
committerEli Schwartz <eschwartz93@gmail.com>2022-05-03 23:03:56 -0400
commit557680f7d6b2a2e7c3d0f04fb0d6529ac7a6d475 (patch)
treededf300cdb4b39a83e7bfa9eb7720f7fb43f0352 /docs/markdown
parent8b3a54e5085933b78a8509103a76bed7ca8cdde4 (diff)
downloadmeson-557680f7d6b2a2e7c3d0f04fb0d6529ac7a6d475.zip
meson-557680f7d6b2a2e7c3d0f04fb0d6529ac7a6d475.tar.gz
meson-557680f7d6b2a2e7c3d0f04fb0d6529ac7a6d475.tar.bz2
add prefer_static built-in option
By default, meson will try to look for shared libraries first before static ones. In the meson.build itself, one can use the static keyword to control if a static library will be tried first but there's no simple way for an end user performing a build to switch back and forth at will. Let's cover this usecase by adding an option that allows a user to specify if they want dependency lookups to try static or shared libraries first. The writer of the meson.build can manually specify the static keyword where appropriate which will override the value of this option.
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Builtin-options.md1
-rw-r--r--docs/markdown/Configuring-a-build-directory.md1
-rw-r--r--docs/markdown/snippets/prefer_static.md9
3 files changed, 11 insertions, 0 deletions
diff --git a/docs/markdown/Builtin-options.md b/docs/markdown/Builtin-options.md
index c524fe4..1e24144 100644
--- a/docs/markdown/Builtin-options.md
+++ b/docs/markdown/Builtin-options.md
@@ -81,6 +81,7 @@ machine](#specifying-options-per-machine) section for details.
| layout {mirror,flat} | mirror | Build directory layout | no | no |
| optimization {0, g, 1, 2, 3, s} | 0 | Optimization level | no | no |
| pkg_config_path {OS separated path} | '' | Additional paths for pkg-config to search before builtin paths | yes | no |
+| prefer_static | false | Whether to try static linking before shared linking | no | no |
| cmake_prefix_path | [] | Additional prefixes for cmake to search before builtin paths | yes | no |
| stdsplit | true | Split stdout and stderr in test logs | no | no |
| strip | false | Strip targets on install | no | no |
diff --git a/docs/markdown/Configuring-a-build-directory.md b/docs/markdown/Configuring-a-build-directory.md
index 1eb8478..34bde4d 100644
--- a/docs/markdown/Configuring-a-build-directory.md
+++ b/docs/markdown/Configuring-a-build-directory.md
@@ -31,6 +31,7 @@ a sample output for a simple project.
install_umask 0022 [preserve, 0000-0777] Default umask to apply on permissions of installed files
layout mirror [mirror, flat] Build directory layout
optimization 3 [0, g, 1, 2, 3, s] Optimization level
+ prefer_static false [true, false] Whether to try static linking before shared linking
strip false [true, false] Strip targets on install
unity off [on, off, subprojects] Unity build
warning_level 1 [0, 1, 2, 3] Compiler warning level to use
diff --git a/docs/markdown/snippets/prefer_static.md b/docs/markdown/snippets/prefer_static.md
new file mode 100644
index 0000000..c63323b
--- /dev/null
+++ b/docs/markdown/snippets/prefer_static.md
@@ -0,0 +1,9 @@
+## New prefer_static built-in option
+
+Users can now set a boolean, `prefer_static`, that controls whether or not
+static linking should be tried before shared linking. This option acts as
+strictly a preference. If the preferred linking method is not successful,
+then Meson will fallback and try the other linking method. Specifically
+setting the `static` kwarg in the meson.build will take precedence over
+the value of `prefer_static` for that specific `dependency` or
+`find_library` call.