summaryrefslogtreecommitdiff
path: root/docs/markdown/Reference-manual.md
AgeCommit message (Collapse)Author
2021-01-27intepreter: Allow using file objects for the script_name of add_*_scriptDylan Baker
It's a bit silly and conveluted to have to call find_program on the output of configure_file, so let's just allow passing files as the script name.
2021-01-27custom_target: Add env kwargXavier Claessens
2021-01-27test: Make timeout <= 0 infinite duractionXavier Claessens
2021-01-21interpreter: accept external programs and dependencies for summaryPaolo Bonzini
2021-01-12summary: align left, not align middleEli Schwartz
aligning along the left is, I think, what most projects want to do. Aligning along the middle looks subjectively ugly, and objectively prevents me from further indenting an element, e.g. Build information: prefix : /usr sysconfdir : /etc conf file : /etc/myprogram.conf
2021-01-05mtest: Add support for rust unit testsDylan Baker
Rust has it's own built in unit test format, which is invoked by compiling a rust executable with the `--test` flag to rustc. The tests are then run by simply invoking that binary. They output a custom test format, which this patch adds parsing support for. This means that we can report each subtest in the junit we generate correctly, which should be helpful for orchestration systems like gitlab and jenkins which can parse junit XML.
2020-12-14doc: fix typos for doubled words [skip ci]Eli Schwartz
"more more" is one place where we don't need more. Fixes #8097
2020-12-03Add prelinking support for static libraries.Jussi Pakkanen
2020-11-12interpreter: Add get_keys function for configuration_data (#7887)Jones
2020-11-05docs: Recommend to use SPDX license identifiers [skip ci]Michael Weiss
Some license identifiers are ambiguous (e.g. "GPL3"). The SPDX license identifiers avoid this by providing standardized and unique identifiers (e.g. "GPL-3.0-only" or "GPL-3.0-or-later" for the previous example). Because SPDX short-form identifiers are also both human- and machine-readable we should recommend them in the documentation. More information (advantages, details, etc.) can be found here: - https://spdx.dev/resources/use/#identifiers - https://spdx.dev/ids/ Fix #7905.
2020-10-19fix markdown issuePaolo Bonzini
2020-10-16Fix consistency in variables kwargXavier Claessens
Share common code to extract the `variables` kwarg in declare_dependency() and pkg.generate().
2020-10-08dependency: support boolean argument "allow_fallback"Paolo Bonzini
Sometimes, distros want to configure a project so that it does not use any bundled library. In this case, meson.build might want to do something like this, where slirp is a combo option with values auto/system/internal: slirp = dependency('', required: false) if get_option('slirp') != 'internal' slirp = dependency('slirp', required: get_option('slirp') == 'system') endif if not slirp.found() slirp = subproject('libslirp', ...) .variable('...') endif and we cannot use "fallback" because the "system" value should never look for a subproject. This worked until 0.54.x, but in 0.55.x this breaks because of the automatic subproject search. Note that the desired effect here is backwards compared to the policy of doing an automatic search on "required: true"; we only want to do the search if "required" is false! It would be possible to look for the dependency with `required: false` and issue the error manually, but it's ugly and it may produce an error message that looks "different" from Meson's. Instead, with this change it is possible to achieve this effect in an even simpler way: slirp = dependency('slirp', required: get_option('slirp') != 'auto', allow_fallback: get_option('slirp') == 'system' ? false : ['slirp', 'libslirp_dep']) The patch also adds support for "allow_fallback: true", which is simple and enables automatic fallback to a wrap even for non-required dependencies.
2020-10-08docs: improve documentation of subproject fallbackPaolo Bonzini
Automatic fallback to subprojects is complicated and should be pointed out outside the "fallback" keyword argument. It is also surprising that fallback to a subproject will not happen if override_dependency has already been used with the request dependency. Document all this.
2020-10-07Add win_subsystem kwarg. Closes #7765.Jussi Pakkanen
2020-10-02docs: Fixup find_program search path documentation [skip ci]Nirbheek Chauhan
It was slightly wrong, and also make it a bullet point for easier parsing.
2020-10-01deprecated get_configtool_variable and get_pkgconfig_variableDylan Baker
The get_variable method is able to do everything they do and more, making it generally more useful. Let's tell people to stop using the old ones.
2020-10-01Document search order of find_programRasmus Thomsen
2020-10-01document keys() method of dictionary object [skip ci]Alexandros Theodotou
2020-09-29Merge pull request #7772 from xclaesse/deprecate-source-rootJussi Pakkanen
Deprecate meson.build_root() and meson.source_root()
2020-09-29Improve documentation about using shell in custom_target() [skip ci]Jon Turney
Add a note about the portability of using shell constructs in the custom_target() command.
2020-09-28Add meson.project_build/source_root() methodsXavier Claessens
2020-09-23Deprecate meson.build_root() and meson.source_root()Xavier Claessens
Those function are common source of issue when used in a subproject because they point to the parent project root which is rarely what is expected and is a violation of subproject isolation.
2020-09-14InternalDependency: Add as_link_whole() methodXavier Claessens
2020-09-10Don't require build machine compilers for project() languagesJon Turney
This means that, in the common case of a simple meson.build which doesn't contain any 'native: true' targets, we won't require a native compiler when cross-compiling, without needing any changes in the meson.build.
2020-09-06doc: Add missing method arguments [skip ci]Michal Sojka
Documentation of most methods mentions method arguments enclosed in parentheses. Two methods are an exception and we fix them here to make the manual more consistent.
2020-09-05docs: Fix typo in Reference-manual.md [skip ci]Krzysztof Małysa
2020-08-15Add that prefix keyword works for cc.get_defineJohn Scott
2020-07-20string: add substring methodStéphane Cerveau
This method aims to offer a simple way to 'substring' an existing string with start and end values.
2020-07-09doc: Small tweaks to fallback documentation [skip ci]Xavier Claessens
2020-07-01wrap: Add 'provide' sectionXavier Claessens
2020-07-01Implicit dependency fallback when a subproject wrap or dir existsXavier Claessens
2020-06-30Cleaned up Reference docs [skip ci]TheQwertiest
2020-06-11Correct argument typo in partial_dependnecy (#7300) [skip ci]Phillip Johnston
Should be "sources" not "source" ``` ../meson.build:162: WARNING: Passed invalid keyword argument "source". WARNING: This will become a hard error in the future. Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/mesonbuild/mesonmain.py", line 131, in run return options.run_func(options) File "/usr/local/lib/python3.7/site-packages/mesonbuild/msetup.py", line 245, in run app.generate() File "/usr/local/lib/python3.7/site-packages/mesonbuild/msetup.py", line 159, in generate self._generate(env) File "/usr/local/lib/python3.7/site-packages/mesonbuild/msetup.py", line 192, in _generate intr.run() File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreter.py", line 4359, in run super().run() File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 465, in run self.evaluate_codeblock(self.ast, start=1) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 490, in evaluate_codeblock raise e File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 483, in evaluate_codeblock self.evaluate_statement(cur) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 498, in evaluate_statement self.assignment(cur) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 1151, in assignment value = self.evaluate_statement(node.value) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 500, in evaluate_statement return self.method_call(cur) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 895, in method_call return obj.method_call(method_name, args, self.kwargs_string_keys(kwargs)) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 39, in method_call return method(args, kwargs) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 285, in wrapped return f(*wrapped_args, **wrapped_kwargs) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 151, in wrapped return f(*wrapped_args, **wrapped_kwargs) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreterbase.py", line 213, in wrapped return f(*wrapped_args, **wrapped_kwargs) File "/usr/local/lib/python3.7/site-packages/mesonbuild/interpreter.py", line 484, in partial_dependency_method pdep = self.held_object.get_partial_dependency(**kwargs) TypeError: get_partial_dependency() got an unexpected keyword argument 'source' FAILED: build.ninja ```
2020-05-18pass exe_wrapper to test scripts through the environmentDylan Baker
This adds a new MESON_EXE_WRAPPER environment variable containing the string form of the exe_wrapper, if there is an exe_wrapper defined. Fixes #4427
2020-05-14interpreter: Rename has_exe_wrapper -> can_run_host_binariesDylan Baker
The implementation of this function has changed enough that the name doesn't really reflect what it actually does. It basically returns true unless you're cross compiling, need and exe_wrapper, and don't have one. The original function remains but is marked as deprecated. This makes one small change the meson source language, which is that it defines that can_run_host_binaries will return true in build == host compilation, which was the behavior that already existed. Previously this was undefined in build == host compilation.
2020-05-06Merge pull request #7064 from dcbaker/gtest-protocolJussi Pakkanen
Add support for Gtest as a test protocol
2020-05-04Add native support for gtest testsDylan Baker
Gtest can output junit results with a command line switch. We can parse this to get more detailed results than the returncode, and put those in our own Junit output. We basically just throw away the top level 'testsuites' object, then fixup the names of the tests, and shove that into our junit.
2020-05-03Merge pull request #7060 from dcbaker/install-script-targetsJussi Pakkanen
Allow meson.add_*_script to take additional types
2020-04-30Docs: Update link_language docs to explain when it should be usedDylan Baker
2020-04-30docs: Update documentation for add_*_scriptDylan Baker
2020-04-28find_program: Fixes when the program has been overridden by executableXavier Claessens
- ExternalProgramHolder has path() method while CustomTargetHolder and BuildTargetHolder have full_path(). - The returned ExternalProgramHolder's path() method was broken, because build.Executable object has no get_path() method, it needs the backend. - find_program('overridden_prog', version : '>=1.0') was broken because it needs to execute the exe that is not yet built. Now assume the program has the (sub)project version. - If the version check fails, interpreter uses ExternalProgramHolder.get_name() for the error message but build.Executable does not implement get_name() method.
2020-04-12Merge pull request #6958 from jon-turney/fix-name-prefix-explicit-defaultJussi Pakkanen
Fix library(name_prefix: [])
2020-04-11docs: fix the docs for install_subdir's strip_directory [skip ci]Peter Hutterer
When set to **true** only the last component is used. And throw in two minor grammatical fixes while we're there.
2020-04-11Refine documentation of default name_prefixJon Turney
Refine documentation of the default name_prefix, so people don't get the impression they can write logic which uses 'lib' as the default, when they should be defaulting to '[]', to let us take care of the complexities.
2020-03-28docs: why 'ninja test' depends on build_by_default targets [skip ci]Marc Herbert
Fixes #1949
2020-03-19cmake: Add find_package COMPONETS supportDaniel Mensinger
2020-03-09Merge pull request #6532 from jon-turney/languages-native-kwargJussi Pakkanen
Add add_languages(native:)
2020-03-06Improve logged messages for overriden dependenciesXavier Claessens
2020-03-06Simplify dependency() fallbackXavier Claessens
Now that subprojects can override the dependency name, there is no need to provide a variable name for the fallback any more.