diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-08 18:33:49 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-12 13:33:00 +0000 |
commit | c5a32c2afe843798d714fc9087bf55ad996b4052 (patch) | |
tree | 646008b174c405b5d419a6a87c13b9e63b62a402 /docs/markdown/snippets | |
parent | 7a159ff1e1e947f20a017bbc8e89c1701a9d7098 (diff) | |
download | meson-c5a32c2afe843798d714fc9087bf55ad996b4052.zip meson-c5a32c2afe843798d714fc9087bf55ad996b4052.tar.gz meson-c5a32c2afe843798d714fc9087bf55ad996b4052.tar.bz2 |
Refine behaviour of add_languages() when native: is missing
This improves the common case of a simple meson.build which doesn't
contain any 'native: true' targets to not require a native compiler when
cross-compiling, without needing any changes in the meson.build.
v2:
Do it the right way around!
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/native_compiler_not_required.md | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/docs/markdown/snippets/native_compiler_not_required.md b/docs/markdown/snippets/native_compiler_not_required.md index 0847b2b..331b3c7 100644 --- a/docs/markdown/snippets/native_compiler_not_required.md +++ b/docs/markdown/snippets/native_compiler_not_required.md @@ -1,5 +1,20 @@ ## Native (build machine) compilers not always required `add_languages()` gained a `native:` keyword, indicating if a native or cross -compiler is to be used. Currently, for backwards compatibility, if the keyword -is absent, that means both are used. +compiler is to be used. + +For the benefit of existing simple build definitions which don't contain any +`native: true` targets, without breaking backwards compatibility for build +definitions which assume that the native compiler is available after +`add_languages()`, if the `native:` keyword is absent the languages may be used +for either the build or host machine, but are never required for the build +machine. + +This changes the behaviour of the following meson fragment (when cross-compiling +but a native compiler is not available) from reporting an error at +`add_language` to reporting an error at `executable`. + +``` +add_language('c') +executable('main', 'main.c', native: true) +``` |