Skip to content

Commit 09a722c

Browse files
authored
Merge pull request mesonbuild#5263 from Ericson2314/per-machine-cli-args
Per machine 'build_' and '' options
2 parents 27c5d9f + 82e36a6 commit 09a722c

File tree

15 files changed

+255
-146
lines changed

15 files changed

+255
-146
lines changed

docs/markdown/Builtin-options.md

+30-25
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,36 @@ on Linux platforms.
5252

5353
### Core options
5454

55-
Options that have a separate cross option will be prefixed with
56-
cross\_, for example, "cross_pkg_config_path" controls the paths
57-
pkg-config will search for host dependencies in a cross compile.
58-
They have no effect when the host and build machines are the same.
59-
60-
61-
| Option | Default value | Description | Has Separate cross |
62-
| ------ | ------------- | ----------- | ------------------ |
63-
| auto_features {enabled, disabled, auto} | auto | Override value of all 'auto' features | no |
64-
| backend {ninja, vs,<br>vs2010, vs2015, vs2017, xcode} | ninja | Backend to use | no |
65-
| buildtype {plain, debug,<br>debugoptimized, release, minsize, custom} | debug | Build type to use | no |
66-
| debug | true | Debug | no |
67-
| default_library {shared, static, both} | shared | Default library type | no |
68-
| errorlogs | true | Whether to print the logs from failing tests. | no |
69-
| install_umask {preserve, 0000-0777} | 022 | Default umask to apply on permissions of installed files | no |
70-
| layout {mirror,flat} | mirror | Build directory layout | no |
71-
| optimization {0, g, 1, 2, 3, s} | 0 | Optimization level | no |
72-
| pkg_config_path | [] | Additional paths for pkg-config to search before builtin paths | yes |
73-
| cmake_prefix_path | [] | Additional prefixes for cmake to search before builtin paths | yes |
74-
| stdsplit | true | Split stdout and stderr in test logs | no |
75-
| strip | false | Strip targets on install | no |
76-
| unity {on, off, subprojects} | off | Unity build | no |
77-
| warning_level {0, 1, 2, 3} | 1 | Set the warning level. From 0 = none to 3 = highest | no |
78-
| werror | false | Treat warnings as errors | no |
79-
| wrap_mode {default, nofallback,<br>nodownload, forcefallback} | default | Wrap mode to use | no |
55+
Options that are labled "per machine" in the table are set per machine.
56+
Prefixing the option with `build.` just affects the build machine configuration,
57+
while unprefixed just affects the host machine configuration, respectively.
58+
Using the option as-is with no prefix affects all machines. For example:
59+
60+
- `build.pkg_config_path` controls the paths pkg-config will search for just
61+
`native: true` dependencies (build machine).
62+
63+
- `pkg_config_path` controls the paths pkg-config will search for just
64+
`native: false` dependencies (host machine).
65+
66+
| Option | Default value | Description | Is per machine |
67+
| ------ | ------------- | ----------- | -------------- |
68+
| auto_features {enabled, disabled, auto} | auto | Override value of all 'auto' features | no |
69+
| backend {ninja, vs,<br>vs2010, vs2015, vs2017, xcode} | ninja | Backend to use | no |
70+
| buildtype {plain, debug,<br>debugoptimized, release, minsize, custom} | debug | Build type to use | no |
71+
| debug | true | Debug | no |
72+
| default_library {shared, static, both} | shared | Default library type | no |
73+
| errorlogs | true | Whether to print the logs from failing tests. | no |
74+
| install_umask {preserve, 0000-0777} | 022 | Default umask to apply on permissions of installed files | no |
75+
| layout {mirror,flat} | mirror | Build directory layout | no |
76+
| optimization {0, g, 1, 2, 3, s} | 0 | Optimization level | no |
77+
| pkg_config_path {OS separated path} | '' | Additional paths for pkg-config to search before builtin paths | yes |
78+
| cmake_prefix_path | [] | Additional prefixes for cmake to search before builtin paths | yes |
79+
| stdsplit | true | Split stdout and stderr in test logs | no |
80+
| strip | false | Strip targets on install | no |
81+
| unity {on, off, subprojects} | off | Unity build | no |
82+
| warning_level {0, 1, 2, 3} | 1 | Set the warning level. From 0 = none to 3 = highest | no |
83+
| werror | false | Treat warnings as errors | no |
84+
| wrap_mode {default, nofallback,<br>nodownload, forcefallback} | default | Wrap mode to use | no |
8085

8186
## Base options
8287

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Specifying options per mer machine
2+
3+
Previously, no cross builds were controllable from the command line.
4+
Machine-specific options like the pkg-config path and compiler options only
5+
affected native targets, that is to say all targets in native builds, and
6+
`native: true` targets in cross builds. Now, prefix the option with `build.` to
7+
affect build machine targets, and leave it unprefixed to affect host machine
8+
targets.
9+
10+
For those trying to ensure native and cross builds to the same platform produced
11+
the same result, the old way was frustrating because very different invocations
12+
were needed to affect the same targets, if it was possible at all. Now, the same
13+
command line arguments affect the same targets everwhere --- Meson is closer to
14+
ignoring whether the "overall" build is native or cross, and just caring about
15+
whether individual targets are for the build or host machines.

0 commit comments

Comments
 (0)