aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Commands.md29
-rw-r--r--docs/markdown/Dependencies.md6
-rw-r--r--docs/markdown/snippets/dataonly-pkgconfig-default-install-path.md4
-rw-r--r--docs/markdown/snippets/env2mfile.md40
-rw-r--r--docs/markdown/snippets/openssl_dependency.md11
-rw-r--r--docs/markdown/snippets/rust_proc_macro_crates.md16
-rw-r--r--docs/markdown/snippets/strip.md5
-rw-r--r--docs/yaml/functions/_build_target_base.yaml20
8 files changed, 131 insertions, 0 deletions
diff --git a/docs/markdown/Commands.md b/docs/markdown/Commands.md
index 3542aa4..f905d2c 100644
--- a/docs/markdown/Commands.md
+++ b/docs/markdown/Commands.md
@@ -150,6 +150,35 @@ Create a project in `sourcedir`:
meson init -C sourcedir
```
+### env2mfile
+
+*This command is experimental and subject to change.*
+
+*{Since 0.62.0}*
+
+{{ env2mfile_usage.inc }}
+
+Create native and cross files from the current environment, typically
+by sniffing environment variables like `CC` and `CFLAGS`.
+
+{{ env2mfile_arguments.inc }}
+
+#### Examples:
+
+Autodetect the current cross build environment:
+
+```
+meson env2mfile --cross -o current_cross.txt --cpu=arm7a --cpu-family=arm --system=linux
+```
+
+Generate a cross build using Debian system information:
+
+```
+meson env2mfile --cross --debarch=armhf -o deb_arm_cross.txt
+```
+
+
+
### introspect
{{ introspect_usage.inc }}
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md
index 8165955..15da929 100644
--- a/docs/markdown/Dependencies.md
+++ b/docs/markdown/Dependencies.md
@@ -625,6 +625,12 @@ for OpenMP support.
The `language` keyword may used.
+## OpenSSL
+
+*(added 0.62.0)*
+
+`method` may be `auto`, `pkg-config`, `system` or `cmake`.
+
## pcap
*(added 0.42.0)*
diff --git a/docs/markdown/snippets/dataonly-pkgconfig-default-install-path.md b/docs/markdown/snippets/dataonly-pkgconfig-default-install-path.md
new file mode 100644
index 0000000..d968158
--- /dev/null
+++ b/docs/markdown/snippets/dataonly-pkgconfig-default-install-path.md
@@ -0,0 +1,4 @@
+## `dataonly` Pkgconfig Default Install Path
+
+The default install path for `dataonly` pkgconfig files has changed from
+`${libdir}/pkgconfig` to `${datadir}/pkgconfig`.
diff --git a/docs/markdown/snippets/env2mfile.md b/docs/markdown/snippets/env2mfile.md
new file mode 100644
index 0000000..a575618
--- /dev/null
+++ b/docs/markdown/snippets/env2mfile.md
@@ -0,0 +1,40 @@
+## Experimental command to convert environments to cross files
+
+Meson has a new command `env2mfile` that can be used to convert
+"environment variable based" cross and native compilation environments
+to Meson machine files. This is especially convenient for e.g. distro
+packagers so they can easily generate unambiguous configuration files
+for packge building.
+
+As an example here's how you would generate a cross file that takes
+its settings from the `CC`, `CXX`, `CFLAGS` etc environment variables.
+
+ meson env2mfile --cross --system=baremetal --cpu=armv7 --cpu-family=arm -o armcross.txt
+
+The command also has support for generating Debian build files using
+system introspection:
+
+ meson env2mfile --cross --debarch armhf -o debarmhf_cross.txt
+
+Note how you don't need to specify any system details, the command
+gets them transparently via `dpkg-architecture`.
+
+Creating a native file is done in the same way:
+
+ meson env2mfile --native -o current_system.txt
+
+This system will detect if the `_FOR_BUILD` environment variables are
+enabled and then uses them as needed.
+
+With this you should be able to convert any envvar-based cross build
+setup to cross and native files and then use those. This means, among
+other things, that you can then run your compilations from any shell,
+not just the special one that has all the environment variables set.
+
+As this functionality is still a bit in flux, the specific behaviour
+and command line arguments to use are subject to change. Because of
+this the main documentation has not yet been updated.
+
+Please try this for your use cases and report to us if it is working.
+Patches to make the autodetection work on other distros and platforms
+are also welcome.
diff --git a/docs/markdown/snippets/openssl_dependency.md b/docs/markdown/snippets/openssl_dependency.md
new file mode 100644
index 0000000..f6f9b63
--- /dev/null
+++ b/docs/markdown/snippets/openssl_dependency.md
@@ -0,0 +1,11 @@
+## New custom dependency for OpenSSL
+
+Detecting an OpenSSL installation in a cross-platform manner can be
+complicated. Officially, pkg-config is supported by upstream. Unofficially,
+cmake includes a FindOpenSSL using a different name and which requires
+specifying modules.
+
+Meson will now allow the pkg-config name to work in all cases using the following lookup order:
+- prefer pkg-config if at all possible
+- attempt to probe the system for the standard library naming, and retrieve the version from the headers
+- if all else fails, check if cmake can find it
diff --git a/docs/markdown/snippets/rust_proc_macro_crates.md b/docs/markdown/snippets/rust_proc_macro_crates.md
new file mode 100644
index 0000000..780a5b3
--- /dev/null
+++ b/docs/markdown/snippets/rust_proc_macro_crates.md
@@ -0,0 +1,16 @@
+## Rust proc-macro crates
+
+Rust has these handy things called proc-macro crates, which are a bit like a
+compiler plugin. We can now support them, simply build a [[shared_library]] with
+the `rust_crate_type` set to `proc-macro`.
+
+```meson
+proc = shared_library(
+ 'proc',
+ 'proc.rs',
+ rust_crate_type : 'proc-macro',
+ install : false,
+)
+
+user = executable('user, 'user.rs', link_with : proc)
+```
diff --git a/docs/markdown/snippets/strip.md b/docs/markdown/snippets/strip.md
new file mode 100644
index 0000000..e971df6
--- /dev/null
+++ b/docs/markdown/snippets/strip.md
@@ -0,0 +1,5 @@
+## `meson install --strip`
+
+It is now possible to strip targets using `meson install --strip` even if
+`-Dstrip=true` option was not set during configuration. This allows doing
+stripped and not stripped installations without reconfiguring the build.
diff --git a/docs/yaml/functions/_build_target_base.yaml b/docs/yaml/functions/_build_target_base.yaml
index 4db37f4..87966f6 100644
--- a/docs/yaml/functions/_build_target_base.yaml
+++ b/docs/yaml/functions/_build_target_base.yaml
@@ -276,3 +276,23 @@ kwargs:
version specification such as `windows,6.0`. See [MSDN
documentation](https://docs.microsoft.com/en-us/cpp/build/reference/subsystem-specify-subsystem)
for the full list.
+
+ rust_crate_type:
+ type: str
+ since: 0.41.0
+ description: |
+ Set the specific type of rust crate to compile (when compiling rust).
+
+ If the target is an [[executable]] this defaults to "bin", the only
+ allowed value.
+
+ If it is a [[static_library]] it defaults to "lib", and may be "lib",
+ "staticlib", or "rlib". If "lib" then Rustc will pick a default, "staticlib"
+ means a C ABI library, "rlib" means a Rust ABI.
+
+ If it is a [[shared_library]] it defaults to "lib", and may be "lib",
+ "dylib", "cdylib", or "proc-macro". If "lib" then Rustc will pick a
+ default, "cdylib" means a C ABI library, "dylib" means a Rust ABI, and
+ "proc-macro" is a special rust proceedural macro crate.
+
+ "proc-macro" is new in 0.62.0.