diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-09-28 17:32:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 17:32:44 +0300 |
commit | fa47d8dab048f8880091f24b77eb192b82a35e9e (patch) | |
tree | 764b54a18eb49003e334fe2fbb7fc0b4025d6bac /docs/markdown/snippets | |
parent | 5fa0fd3b473f792bd7333cf6ae6e2f4c851b6108 (diff) | |
parent | 32dbdff3b2d37d1ec7ef976c0b4f30d1d0472e70 (diff) | |
download | meson-fa47d8dab048f8880091f24b77eb192b82a35e9e.zip meson-fa47d8dab048f8880091f24b77eb192b82a35e9e.tar.gz meson-fa47d8dab048f8880091f24b77eb192b82a35e9e.tar.bz2 |
Merge pull request #9014 from bonzini/mixed-language-link
Use appropriate compiler for the source file for "links" tests with file argument
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/mixed_language_linker_tests.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/markdown/snippets/mixed_language_linker_tests.md b/docs/markdown/snippets/mixed_language_linker_tests.md new file mode 100644 index 0000000..8b94edb --- /dev/null +++ b/docs/markdown/snippets/mixed_language_linker_tests.md @@ -0,0 +1,21 @@ +== Link tests can use sources for a different compiler == + +Usually, the `links` method of the compiler object uses a single program +invocation to do both compilation and linking. Starting with this version, +whenever the argument to `links` is a file, Meson will check if the file +suffix matches the compiler object's language. If they do not match, +as in the following case: + +``` +cxx = meson.get_compiler('cpp') +cxx.links(files('test.c')) +``` + +then Meson will separate compilation and linking. In the above example +`test.c` will be compiled with a C compiler and the resulting object file +will be linked with a C++ compiler. This makes it possible to detect +misconfigurations of the compilation environment, for example when the +C++ runtime is not compatible with the one expected by the C compiler. + +For this reason, passing file arguments with an unrecognized suffix to +`links` will cause a warning. |