Commit Graph

605 Commits

Author SHA1 Message Date
Xavier Claessens 71bfec7ec1 cmake: subproject() supports the 'required' kwarg 2019-10-01 13:30:15 -04:00
Xavier Claessens dc5ad1fad9 pkgconfig: Do not include uninstalled static libraries 2019-10-01 13:06:45 -04:00
Daniel Mensinger fbddeeb4ac cmake: define set_and_check in CMake package config (fixes #5889) 2019-09-26 20:29:42 +03:00
Zbigniew Jędrzejewski-Szmek f745e8fc4d Use functools cache instead of open-coded implementation
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-25 14:52:07 +02:00
Zbigniew Jędrzejewski-Szmek 11c1f8644c Drop unused variable 2019-09-25 14:52:07 +02:00
Zbigniew Jędrzejewski-Szmek 3a6920ebdc Add helper to print warnings once
The helper is general, although in this patch it is only used for
warnings. No functional change intended.
2019-09-25 14:52:07 +02:00
Xavier Claessens 5d0ced220c pkgconfig: Fix ordering of public libraries
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-17 11:56:46 -04:00
Ross Burton ad368cfc07 modules/python: improve log when probing Python binary
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-12 15:09:40 +03:00
Aleksey Gurtovoy 75daed27bc mesonlib.split_args/quote_arg/join_args 2019-09-05 23:42:47 +03:00
Simon Allen 6a7b4be824 Handle case of dependency('threads') in 'requires' 2019-09-02 21:34:22 +03:00
Thibault Saunier edec2ee0ee gnome: Handle overriden g-ir-scanner
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-17 12:07:20 +03:00
Xavier Claessens 172a355b93 Revert "gnome: Use find_program() to get glib-compile-resources"
This reverts commit 0ab3d97566.
2019-08-13 09:34:25 -04:00
Xavier Claessens 0ab3d97566 gnome: Use find_program() to get glib-compile-resources
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-12 04:26:27 +00:00
Jussi Pakkanen 5f2e44b0dd Make gettext targets no-ops if gettext is not installed. Closes: #821. 2019-08-04 21:46:52 +03:00
Marc-André Lureau 8ba1405742 sourceset: add all_dependencies() method
'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-04 21:44:52 +03:00
Marc-André Lureau 940ebd658b sourceset: fix using FeatureCheck decorators
The feature check facilities need to have access to subproject.
2019-08-04 21:44:52 +03:00
Xavier Claessens 44ac680e55 gtkdoc: Use find_program() to get gtkdoc tools
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-08-04 21:40:55 +03:00
Marc-André Lureau 06aaffa4e1 Allow kconfig to read from configure_file()
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-31 21:42:24 +03:00
Dylan Baker c8a6a44850 compilers: pull sanitzier args into compiler classes
This simplifies and cleans things up.
2019-07-23 09:58:24 +00:00
Xavier Claessens f5da881126 gtkdoc: Add 'check' kwarg (#5591)
* 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-16 22:50:33 +03:00
Thibault Saunier 6813ef1e24 cmake: Handle disabling subprojects 2019-07-13 05:17:01 +00:00
ePirat b347f00dc0 Fix windres module argument flattening 2019-07-05 22:20:16 +03:00
Jussi Pakkanen af1a81fffc Improve error message when Python is not usable. [skip ci] 2019-06-27 20:45:58 +03:00
Alexander Kanavin ecbfc08dca gnome.py: correctly pick the compiler for gtk-doc builds 2019-06-27 09:17:49 -07:00
Dylan Baker 15ab1f64f9 modules/python: add a modules keyword argument
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-12 14:13:20 +03:00
John Ericson 07777e15d4 Purge `is_cross` and friends without changing user interfaces
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-09 13:13:25 -04:00
Daniel Mensinger e02c101575
cmake: moved subprojects into the CMake module 2019-06-06 18:27:05 +02:00
Christoph Reiter 20eb948b97 gnome: make sure the target build directory is passed first for linking
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 8377ea45aa

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-28 20:25:37 +03:00
Paolo Bonzini d894c48660 new module "sourceset" to match source file lists against configuration data
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-22 12:09:09 +02:00
Federico Mena Quintero 60f34a1f51 gnome: use g_intern_static_string() for enum/flags type names
We are emitting a static string, so use that shortcut function to
intern it, which will save one allocation.
2019-05-21 21:53:15 +03:00
Jussi Pakkanen ef024583df
Merge pull request #5276 from dcbaker/pkg-config-path-invalidate-cache
coredata: add pkg_config_path to depedency cache key
2019-05-20 22:50:12 +03:00
Jon Turney 58870fda16 Remove compilers from ModuleState object
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-20 11:29:17 -07:00
Dylan Baker 146e97e974 Use dependency cache 2019-05-20 10:05:36 -07:00
Score_Under 38b347ecd0 Do not filter out repeated cflags
Using a set breaks certain flags like `--param'.
2019-05-15 14:47:49 +03:00
Jussi Pakkanen 7b8ef78bc0
Merge pull request #5331 from dcbaker/icl
ICL (Intel for Windows) support
2019-05-14 00:24:48 +03:00
Dylan Baker de011e031c modules/windows: ICL uses rc, not windres 2019-05-13 11:22:31 -07:00
myd7349 5ede0f5ef0 Force pkgconfig to UTF-8 2019-05-12 00:30:44 +03:00
Dylan Baker c0aa89e57f
Merge pull request #4952 from mensinda/cacheCompiles
Cache compilers.compile() in coredata
2019-05-02 14:54:02 -07:00
Daniel Mensinger e75211d321
Fix builtin variable names 2019-04-29 12:17:40 +02:00
Daniel Mensinger cb1ef0c449 cmake: Use CMAKE_ROOT instead of _INCLUDE_FILE (closes #5218) 2019-04-28 19:29:56 +03:00
Daniel Mensinger dfe3d56bfd
Print '(cached)' when compiler result was cached 2019-04-28 14:33:21 +02:00
Dylan Baker 5678468c2c Don't use len() to test for container emptiness
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-25 12:28:51 -07:00
Thibault Saunier 26e205293a hotdoc: Handle werror 2019-04-24 21:55:42 +03:00
Thibault Saunier 083a53815c hotdoc: Take into account boolean value to pass flag like arguments 2019-04-24 21:55:42 +03:00
Konstantin 841995cddf i18n: add args keyword to merge_file
* i18n: add args keyword to merge_file

* i18n: add testcase to msgfmt args
2019-04-22 14:54:05 +03:00
Jussi Pakkanen 4e4f97edb3 Can run argument strings with internal Python. Closes #5217. 2019-04-21 15:14:34 +03:00
Dylan Baker a710b83a67 modules/python: normalize output for disabled by feature
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-03 14:48:29 -07:00
Dylan Baker de48e887b8 modules/python: Do disabler check after validating inputs
This will help developers not introduce bugs (say putting 3 instead of
"python3"), and will be useful for the next patch.
2019-04-03 14:48:29 -07:00
Dylan Baker 82346a2bd2 modules/python: Report program found in find_installation()
Currently find_installation is silent, which is pretty annoying. Let's
log it.
2019-04-03 14:48:29 -07:00
Dylan Baker 3d04e5a150 modules/python: Remove spaces around keyword arguments
just small style cleanups.
2019-04-02 15:34:55 -07:00