aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <10931741+scivision@users.noreply.github.com>2019-05-02 16:26:51 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-05-02 23:26:51 +0300
commit06bfc2dab61c5bf79265a8db777b02732ee86ecf (patch)
tree0ed6065a804d972c950826b86e1241ed86b759ce /docs/markdown/snippets
parent16463046b10818910da72d892d53663496179606 (diff)
downloadmeson-06bfc2dab61c5bf79265a8db777b02732ee86ecf.zip
meson-06bfc2dab61c5bf79265a8db777b02732ee86ecf.tar.gz
meson-06bfc2dab61c5bf79265a8db777b02732ee86ecf.tar.bz2
per-target manual specification of link_language
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/link_language.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/snippets/link_language.md b/docs/markdown/snippets/link_language.md
new file mode 100644
index 0000000..28ebe8b
--- /dev/null
+++ b/docs/markdown/snippets/link_language.md
@@ -0,0 +1,10 @@
+## New target keyword argument: `link_language`
+There may be situations for which the user wishes to manually specify the linking language.
+For example, a C++ target may link C, Fortran, etc. and perhaps the automatic detection in Meson does not pick the desired compiler.
+The user can manually choose the linker by language per-target like this example of a target where one wishes to link with the Fortran compiler:
+```meson
+executable(..., link_language : 'fortran')
+```
+
+A specific case this option fixes is where for example the main program is Fortran that calls C and/or C++ code.
+The automatic language detection of Meson prioritizes C/C++, and so an compile-time error results like `undefined reference to main`, because the linker is C or C++ instead of Fortran, which is fixed by this per-target override.