aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)AuthorFilesLines
2019-09-26cmake: define set_and_check in CMake package config (fixes #5889)Daniel Mensinger1-0/+12
2019-09-25Use functools cache instead of open-coded implementationZbigniew Jędrzejewski-Szmek1-11/+4
Functional behaviour is not identical, because the cache not set when an exception is thrown. I hope this doesn't matter in practice.
2019-09-25Drop unused variableZbigniew Jędrzejewski-Szmek1-1/+0
2019-09-25Add helper to print warnings onceZbigniew Jędrzejewski-Szmek2-24/+15
The helper is general, although in this patch it is only used for warnings. No functional change intended.
2019-09-17pkgconfig: Fix ordering of public librariesXavier Claessens1-3/+8
The main library must come before extra libraries, because they are likely to be dependencies of the main library that get promoted from private to public. This was causing static link issues with glib-2.0.pc.
2019-09-12modules/python: improve log when probing Python binaryRoss Burton1-9/+8
If the Python binary that we find doesn't return valid JSON when asked to run a small script, show the command being ran and stdout/stderr in meson-log.txt. Fixes: #5914
2019-09-05mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy2-7/+6
2019-09-02Handle case of dependency('threads') in 'requires'Simon Allen1-0/+2
2019-08-17gnome: Handle overriden g-ir-scannerThibault Saunier1-2/+8
When g-ir-scanner is overriden, we can't call it at configure time but we know what options are avalaible (as it started using meson after checked options where added) so do not try to call it to retrieve the version as it will fail. Also see https://github.com/mesonbuild/meson/issues/3442
2019-08-13Revert "gnome: Use find_program() to get glib-compile-resources"Xavier Claessens1-5/+4
This reverts commit 0ab3d97566e8876532ecaf31b948a9ae3337b564.
2019-08-12gnome: Use find_program() to get glib-compile-resourcesXavier Claessens1-4/+5
GLib does not currently use override_find_program() for this tool because it is compiled and would not work in cross build. But this prepares Meson for when/if GLib will rewrite it in Python. See https://gitlab.gnome.org/GNOME/glib/issues/1859.
2019-08-04Make gettext targets no-ops if gettext is not installed. Closes: #821.Jussi Pakkanen1-2/+14
2019-08-04sourceset: add all_dependencies() methodMarc-André Lureau1-0/+9
'if_true' sources should be built with their dependencies, as illustrated by test case change. Ideally, I think we would want only the files with the dependencies to be built with the flags, but that would probably change the way sourceset are used.
2019-08-04sourceset: fix using FeatureCheck decoratorsMarc-André Lureau1-4/+5
The feature check facilities need to have access to subproject.
2019-08-04gtkdoc: Use find_program() to get gtkdoc toolsXavier Claessens1-0/+5
This will allow using gtk-doc as a subproject instead of having to install it on the system. It also has the side effect of failing at configuration time with a proper message if gtkdoc is not installed, instead of failing at build time with a python backtrace.
2019-07-31Allow kconfig to read from configure_file()Marc-André Lureau1-6/+7
At configure time, kconfig can read from configure_file(). "test cases/kconfig/4 load_config builddir/meson.build" was already showing a workaround, now it actually can take configure_file input directly.
2019-07-23compilers: pull sanitzier args into compiler classesDylan Baker1-3/+2
This simplifies and cleans things up.
2019-07-16gtkdoc: Add 'check' kwarg (#5591)Xavier Claessens1-2/+19
* gtkdoc: Add 'check' kwarg This runs gtkdoc-check in meson tests. Also reorganize the gtkdoc test because we cannot reliably build multiple doc into the same directory. Not all files generated by gtk-doc are prefixed with the target name.
2019-07-13cmake: Handle disabling subprojectsThibault Saunier1-1/+4
2019-07-05Fix windres module argument flatteningePirat1-2/+2
2019-06-27Improve error message when Python is not usable. [skip ci]Jussi Pakkanen1-1/+1
2019-06-27gnome.py: correctly pick the compiler for gtk-doc buildsAlexander Kanavin1-4/+1
2019-06-12modules/python: add a modules keyword argumentDylan Baker1-4/+34
This mirrors the modules keyword argument that some dependencies (such as qt and llvm) take. This allows an easier method to determine if modules are installed.
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson5-8/+9
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-06-06cmake: moved subprojects into the CMake moduleDaniel Mensinger1-2/+68
2019-05-28gnome: make sure the target build directory is passed first for linkingChristoph Reiter1-8/+8
determine_rpath_dirs() can return paths to external dependencies not in the build dir and passing them first as a link path leads to g-ir-scanner for example linking against the already installed library instead of the just built one. This was reported in g-i: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/272 and comes up quite often when a library adds some new symbols which aren't present in the system library, which then makes linking fail. The first place where the order is changed is _scan_gir_targets(), which looks like an unintentional change in the refactoring in 8377ea45aa61efbe8e1a75b74 The second place in _get_link_args() has always been that way and only the rpath order is changed, but it looks to me as if the same rules should apply here too.
2019-05-22new module "sourceset" to match source file lists against configuration dataPaolo Bonzini1-0/+190
In QEMU a single set of source files is built against many different configurations in order to generate many executable. Each executable includes a different but overlapping subset of the source files; some of the files are compiled separately for each output, others are compiled just once. Using Makefiles, this is achieved with a complicated mechanism involving a combination of non-recursive and recursive make; Meson can do better, but because there are hundreds of such conditional rules, it's important to keep meson.build files brief and easy to follow. Therefore, this commit adds a new module to satisfy this use case while preserving Meson's declarative nature. Configurations are mapped to a configuration_data object, and a new "source set" object is used to store all the rules, and then retrieve the desired set of sources together with their dependencies. The test case shows how extract_objects can be used to satisfy both cases, i.e. when the object files are shared across targets and when they have to be separate. In the real-world case, a project would use two source set objects for the two cases and then do "executable(..., sources: ... , objects: ...)". The next commit adds such an example.
2019-05-21gnome: use g_intern_static_string() for enum/flags type namesFederico Mena Quintero1-1/+1
We are emitting a static string, so use that shortcut function to intern it, which will save one allocation.
2019-05-20Merge pull request #5276 from dcbaker/pkg-config-path-invalidate-cacheJussi Pakkanen1-1/+1
coredata: add pkg_config_path to depedency cache key
2019-05-20Remove compilers from ModuleState objectJon Turney2-3/+4
It doesn't make much sense to have this and not also have cross-compilers (so any use of this is already pretty suspect as probably wrong when cross-compiling). This information is accessible anyhow via environment.coredata.
2019-05-20Use dependency cacheDylan Baker1-1/+1
2019-05-15Do not filter out repeated cflagsScore_Under1-12/+12
Using a set breaks certain flags like `--param'.
2019-05-14Merge pull request #5331 from dcbaker/iclJussi Pakkanen1-1/+1
ICL (Intel for Windows) support
2019-05-13modules/windows: ICL uses rc, not windresDylan Baker1-1/+1
2019-05-12Force pkgconfig to UTF-8myd73491-1/+1
2019-05-02Merge pull request #4952 from mensinda/cacheCompilesDylan Baker1-1/+1
Cache compilers.compile() in coredata
2019-04-29Fix builtin variable namesDaniel Mensinger2-5/+5
2019-04-28cmake: Use CMAKE_ROOT instead of _INCLUDE_FILE (closes #5218)Daniel Mensinger1-10/+2
2019-04-28Print '(cached)' when compiler result was cachedDaniel Mensinger1-1/+1
2019-04-25Don't use len() to test for container emptinessDylan Baker5-12/+12
I ran the numbers once before (it's in the meson history) but it's *much* faster to *not* use len for testing if a container is empty or not.
2019-04-24hotdoc: Handle werrorThibault Saunier1-0/+3
2019-04-24hotdoc: Take into account boolean value to pass flag like argumentsThibault Saunier1-1/+2
2019-04-22i18n: add args keyword to merge_fileKonstantin1-1/+6
* i18n: add args keyword to merge_file * i18n: add testcase to msgfmt args
2019-04-21Can run argument strings with internal Python. Closes #5217.Jussi Pakkanen1-5/+3
2019-04-03modules/python: normalize output for disabled by featureDylan Baker1-1/+1
Instead of printing a message about how python was skipped, print the normal 'Program foo found:' message, with a "disabled by feature" message added.
2019-04-03modules/python: Do disabler check after validating inputsDylan Baker1-3/+4
This will help developers not introduce bugs (say putting 3 instead of "python3"), and will be useful for the next patch.
2019-04-03modules/python: Report program found in find_installation()Dylan Baker1-3/+5
Currently find_installation is silent, which is pretty annoying. Let's log it.
2019-04-02modules/python: Remove spaces around keyword argumentsDylan Baker1-2/+2
just small style cleanups.
2019-03-28Revert "gnome.compile_resources: Add ld binary method"Jussi Pakkanen2-148/+14
This reverts commit 59791fc56966901038aaaac23942bc8ac6e11494, reversing changes made to e26b5a119e0b3f76cc93f65ecf4251dc6d52ecfe.
2019-03-20Merge pull request #5031 from bonzini/kconfigJussi Pakkanen1-0/+72
Kconfig Module