summaryrefslogtreecommitdiff
path: root/docs/markdown/Reference-manual.md
AgeCommit message (Collapse)Author
2021-10-03docs: Remove the old Reference manualDaniel Mensinger
2021-09-30dependency: Allow searching for multiple namesXavier Claessens
2021-09-30Make custom_target() name argument optionalXavier Claessens
2021-09-28Merge pull request #9014 from bonzini/mixed-language-linkJussi Pakkanen
Use appropriate compiler for the source file for "links" tests with file argument
2021-09-25interpreter: Introduce StringHolderDaniel Mensinger
Another commit in my quest to rid InterpreterBase from all higher level object processing logic. Additionally, there is a a logic change here, since `str.join` now uses varargs and can now accept more than one argument (and supports list flattening).
2021-09-07docs: document new behavior with respect to mixed language link testsPaolo Bonzini
2021-08-23interpreter: Fix dependency(..., static: true) fallbackXavier Claessens
It should build the fallback subprject with default_library=static and override the dependency for both static=True and static kwarg not given. Fixes: #8050.
2021-08-18docs: Remove the deleted function find_libraryDaniel Mensinger
2021-08-17Add install tagsXavier Claessens
Fixes: #7007.
2021-08-16Add unset_variable()Tristan Partin
This should be useful for helping to control variable scope within Meson. CMake has something similar for controlling scope.
2021-08-13Document that custom_target() install_dir can be a listXavier Claessens
2021-06-30interpreter: add required and disabled to importDylan Baker
This is useful both from the perspective of optional functionality that requires a module, and also as I continue to progress with Meson++, which will probably not implement all of the modules that Meson itself does.
2021-06-29Add feed arg to custom_target()Simon Ser
2021-06-22Add Visual Studio 2012/2013 backends (#8803)fanc999
* backends: Add a Visual Studio 2013 backend This is more-or-less a quick port from the VS2015 backend, except that we update the Visual Studio version strings and toolset versions accordingly. Also correct the generator string for Visual Studio 2015 in mesonbuild/cmake/common.py. * backend: Add VS2012 backend Similar to what we did for Visual Studio 2013, add a Visual Studio 2012 backend. * vs2010backend.py: Implement `link_whole:` if needed We actually need Visual Studio 2015 Update 2 to use `/WHOLEARCHIVE:`, which is what we are currently using for `link_whole:` on Visual Studio. For Visual Studio versions before that, we need to expand from the static targets that were indicated by `link_whole:`, and any of the sub-dependent targets that were pulled in via the dependent target's `link_whole:`. This wil ensure `link_whole:` would actually work in such cases. * vs2010backend.py: Handle objects from generated sources Unforunately, we can't use backends.determine_ext_objs() reliably, as the Visual Studio backends handle this differently. * vs2010backend.py: Fix generating VS2010 projects Visual Studio 2010 (at least the Express Edition) does not set the envvar %VisualStudioVersion% in its command prompt, so fix generating VS2010 projects by taking account into this, so that we can determine the location of vcvarsall.bat correctly. * whole archive test: Disable on vs2012/2013 backends too The Visual Studio 2012/2013 IDE has problems handling the items that would be generated from this test case, so skip this test when using --backend=vs[2012|2013]. This test does work for the Ninja backend when VS2012 or VS2013 is used, though. Consolidate this error message with XCode along with the vs2010 backend. * docs: Add the new vs2012 and vs2013 backends Let people know that we have backends for vs2012 and 2013. Also let people know that generating Visual Studio 2010 projects have been fixed and the pre-vs2015 backends now handle the `link_whole:` project option.
2021-06-22Merge pull request #8900 from bonzini/extract-objects-docsJussi Pakkanen
extract_objects: fixes, tests and documentation for using the result in a custom_target
2021-06-22extract_objects: test and document using the result in a custom_targetPaolo Bonzini
QEMU would like to use the result of extract_objects in a custom_target; examples are using objcopy, or using the object files as the key to look up command line arguments in compile_commands.json. This is slightly peculiar and not covered by the test suite, but it works; in order to avoid regressions, add a test case and document it.
2021-06-21fix: Ensure that build targets have all methods from ExternalProgramDaniel Mensinger
As a side-effect from #8885 `find_program()` returns now `Executable` objects when `meson.override_find_program` is called with an executable target. To resolve this conflict the missing methods from `ExternalProgram` are added to `BuildTarget`.
2021-06-18dependency: Empty fallback is the same as allow_fallback: falseXavier Claessens
2021-06-08doc: Fix link to Commands.mdXavier Claessens
2021-06-08interpreter: add feature.disable_auto_if()Paolo Bonzini
Add a method to downgrade an option to disabled if it is not used. This is useful to avoid unnecessary search for dependencies; for example dep = dependency('dep', required: get_option('feature').disable_auto_if(not foo)) can be used instead of the more verbose and complex if get_option('feature').auto() and not foo then dep = dependency('', required: false) else dep = dependency('dep', required: get_option('feature')) endif or to avoid unnecessary dependency searches: dep1 = dependency('dep1', required: get_option('foo')) # dep2 is only used together with dep1 dep2 = dependency('dep2', required: get_option('foo').disable_auto_if(not dep1.found())) ``` Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-06-08interpreter: add feature.require()Paolo Bonzini
Add a method to perform a logical AND on a feature object. The method also takes care of raising an error if 'enabled' is ANDed with false. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-31interpreter: add feature.allowed()Paolo Bonzini
This method simplifies the conversion of Feature objects to booleans. Often, one has to use the "not" operator in order to treat "auto" and "enabled" the same way. "allowed()" also works well in conjunction with the require method that is introduced in the next patch. For example, if get_option('foo').require(host_machine.system() == 'windows').allowed() then src += ['foo.c'] config.set10('HAVE_FOO', 1) endif can be used instead of if host_machine.system() != 'windows' if get_option('foo').enabled() error('...') endif endif if not get_option('foo').disabled() then src += ['foo.c'] config.set10('HAVE_FOO', 1) endif Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-12doc: Add example how to use devenvXavier Claessens
Fixes: #8758
2021-04-15docs: add the 'since' tag to string.replacePeter Hutterer
2021-04-15docs: document default version for declare_dependency()Simon Ser
By default, the project version is picked.
2021-04-09docs: Fix the description of static_library's additional arguments [skip ci]Adam Jackson
2021-04-09Add global_source/build_root()Xavier Claessens
2021-03-23environment(): Allow stacking append() and prepend() (#8547)Xavier Claessens
* environment(): Allow stacking append() and prepend() * Update docs/markdown/Reference-manual.md Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
2021-03-18Allow add_dist_script() in subprojectsXavier Claessens
Fixes: #8440.
2021-03-18interpreter: Add varname as positional arg in dep.get_variable()Xavier Claessens
2021-03-16Add range() functionXavier Claessens
Fixes: #5026.
2021-03-16Add `meson devenv` command and meson.add_devenv()Xavier Claessens
2021-03-09Add str.replace() methodTristan Partin
2021-03-06minstall: Correctly set uid/gid of installed filesPeter Kjellerstedt
In commit caab4d3d, the uid and gid arguments passed to os.chown() by set_chown() were accidentally swapped, causing files to end up with incorrect owner/group if the owner and group are not the same. Also update the documentation to better indicate which argument to install_mode is which. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
2021-03-04docs: Clarify compiler.cmd_array() (#8454)Chris Mayo
Make it easier to understand that this array contains the compiler command, not arguments to it, and may only have one element.
2021-02-27install_man locale supportJason Woodward
Rather than having to manually build the locale aware man paths with `install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')` Support doing `install_man('foo.fr.1', locale: 'fr')`
2021-02-26Allow printing UserOptions in the summaryStephen Gregoratto
2021-02-26meson: add .has_external_property() methodsTim-Philipp Müller
Useful in case of boolean values to distinguish between a boolean value having been set in the native/cross file and not having been provided, which can't be achieved by passing a fallback parameter to .get_external_property().
2021-02-25deprecated `meson.get_cross_property`Dylan Baker
It's a pure subset of `get_external_property`, and has odd behavior in host == build configurations. `get_external_property` is clear, and uses the standard `native : bool` syntax to control host vs build properties
2021-02-25Support multiple args in error()Xavier Claessens
Seems it got forgotten when that was added to warnings() and message(). Fixes: #8414.
2021-02-17Substitute @CURRENT_SOURCE_DIR@ in run_target() and custom_target()Xavier Claessens
run_target() does some variable substitutions since 0.57.0. This is a new behavior, and undocumented, caused by sharing more code with custom_target(). More consistency is better, so document it now. custom_target() was doing variable substitution in the past, because it shared some code with generator(), but that was undocumented. Some refactoring in 0.57.0 caused it to not replace @CURRENT_SOURCE_DIR@, @SOURCE_DIR@, and @BUILD_DIR@ anymore. This patch adds back @CURRENT_SOURCE_DIR@ and document it. It does not add back @SOURCE_DIR@ because it is duplicate with @SOURCE_ROOT@ that has a better name. Also do not add back @BUILD_DIR@ which is duplicate of @PRIVATE_DIR@, and not @BUILD_ROOT@ surprisingly, adding to the confusion.
2021-02-07Make installing non-existing subdirs a supported featurePeter Hutterer
install_subdir() with a non-existing subdir creates the directory in the target directory. This seems like an implementation detail but is quite useful to create new directories for e.g. configuration or plugins in the installed locations. git bisect says this started with 8fe816101467e66792251b4f57e0ddddb537764a. Let's add a test for it and document it to make this behavior official. Limitation: it can only create at the install_dir location, trying to create nested subdirectories does not work and indeed creates the wrong directory structure. That is a bug that should be fixed separately: install_subdir('blah', install_dir: get_option('prefix')) install_subdir('sub/foobar', install_dir: get_option('prefix')) install_subdir('foo/baz', install_dir: get_option('prefix')) $ tree ../_inst ../_inst ├── baz ├── blah └── foobar Fixes #2904
2021-02-07Merge pull request #8288 from bonzini/test-setup-exclude-suitesJussi Pakkanen
introduce add_test_setup(exclude suites: ...) keyword argument
2021-02-05run_target: Add env kwargXavier Claessens
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-02-02doc: fix typosEli Schwartz
2021-02-02interpreter, mtest: introduce add_test_setup(exclude_suites: ...)Paolo Bonzini
This new keyword argument makes it possible to run specific test setups only on a subset of the tests. For example, to mark some tests as slow and avoid running them by default: add_test_setup('quick', exclude_suites: ['slow'], is_default: true) add_test_setup('slow') It will then be possible to run the slow tests with either `meson test --setup slow` or `meson test --suite slow`.
2021-01-31Capitalize "Meson" consistently as it is a proper name. [skip ci]Jussi Pakkanen
2021-01-30add_install_script: add skip_if_destdir kwargXavier Claessens
It is common, at least in GNOME projects, to have scripts that must be run only in the final destination, to update system icon cache, etc. Skipping them from Meson ensures we can properly log that they have not been run instead of relying on such scripts to to it (they don't always).
2021-01-30Rewrap long text lines in docs. [skip ci]Jussi Pakkanen
2021-01-29Can read project version from a file.Jussi Pakkanen