aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2023-04-17 12:46:46 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2023-06-19 18:03:57 +0300
commitb0d2a925849be8826ec5f18755a5aed743f5c72d (patch)
tree0cafe07707aeb97d71cc27ff0f7fe87281b8a9b1 /docs/markdown
parent23efc1abeac2a7b95e22aaeb6ca178b492bf5247 (diff)
downloadmeson-b0d2a925849be8826ec5f18755a5aed743f5c72d.zip
meson-b0d2a925849be8826ec5f18755a5aed743f5c72d.tar.gz
meson-b0d2a925849be8826ec5f18755a5aed743f5c72d.tar.bz2
Add kernel and subsystem properties to machine objects.
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Cross-compilation.md12
-rw-r--r--docs/markdown/Reference-tables.md37
-rw-r--r--docs/markdown/snippets/moremachinedata.md12
3 files changed, 57 insertions, 4 deletions
diff --git a/docs/markdown/Cross-compilation.md b/docs/markdown/Cross-compilation.md
index fb22222..1d0e463 100644
--- a/docs/markdown/Cross-compilation.md
+++ b/docs/markdown/Cross-compilation.md
@@ -212,6 +212,8 @@ target machines look the same. Here is a sample for host machine.
```ini
[host_machine]
system = 'windows'
+subsystem = 'windows'
+kernel = 'nt'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'
@@ -221,9 +223,13 @@ These values define the machines sufficiently for cross compilation
purposes. The corresponding target definition would look the same but
have `target_machine` in the header. These values are available in
your Meson scripts. There are three predefined variables called,
-surprisingly, [[@build_machine]], [[@host_machine]] and [[@target_machine]].
-Determining the operating system of your host machine is simply a
-matter of calling `host_machine.system()`.
+surprisingly, [[@build_machine]], [[@host_machine]] and
+[[@target_machine]]. Determining the operating system of your host
+machine is simply a matter of calling `host_machine.system()`.
+Starting from version 1.2.0 you can get more fine grained information
+using the `.subsystem()` and `.kernel()` methods. The return values of
+these functions are documented in [the reference table
+page](Reference-tables.md).
There are two different values for the CPU. The first one is
`cpu_family`. It is a general type of the CPU. This should have a
diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md
index 7354cd4..b553832 100644
--- a/docs/markdown/Reference-tables.md
+++ b/docs/markdown/Reference-tables.md
@@ -163,9 +163,44 @@ These are provided by the `.system()` method call.
Any string not listed above is not guaranteed to remain stable in
future releases.
+## Kernel names (since 1.2.0)
+
+Native names as returned by the `.kernel()` method.
+
+| Value | Comment |
+| ----- | ------- |
+| linux | |
+| freebsd | |
+| openbsd | |
+| netbsd | |
+| nt | |
+| xnu | Kernel of various Apple OSes |
+| sunos | |
+| dragonfly | |
+| haiku| |
+| none | For e.g. bare metal embedded |
+
+
+## Subsystem names (since 1.2.0)
+
+A more specific description of the system in question. Most values are
+meant to be used in cross files only, as those platforms can not run
+Meson natively.
+
+| Value | Comment |
+| ----- | ------- |
+| macos | Apple macOS (formerly OSX) |
+| ios | Apple iOS |
+| ios-simulator | |
+| tvos | Apple tvOS |
+| tvos-simulator | |
+| watchos | Apple watchOS |
+| watchos-simulator | |
+
## Language arguments parameter names
-These are the parameter names for passing language specific arguments to your build target.
+These are the parameter names for passing language specific arguments
+to your build target.
| Language | compiler name | linker name |
| ------------- | ------------- | ----------------- |
diff --git a/docs/markdown/snippets/moremachinedata.md b/docs/markdown/snippets/moremachinedata.md
new file mode 100644
index 0000000..978cb9c
--- /dev/null
+++ b/docs/markdown/snippets/moremachinedata.md
@@ -0,0 +1,12 @@
+## Machine objects get `kernel` and `subsystem` properties
+
+Meson has traditionally provided a `system` property to detect the
+system being run on. However this is not enough to reliably
+differentiate between e.g. an iOS platform from a watchOS one. Two new
+properties, namely `kernel` and `subsystem` have been added so these
+setups can be reliably detected.
+
+These new properties are not necessary in cross files for now, but if
+they are not defined and a build file tries to access them, Meson will
+exit with a hard error. It is expected that at some point in the
+future defining the new properties will become mandatory.