Commit Graph

307 Commits

Author SHA1 Message Date
Xavier Claessens f40e1567f5 Update mesonbuild/modules/gnome.py
Co-authored-by: Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
2020-06-16 08:21:35 -04:00
Xavier Claessens 2ebda584ad Update mesonbuild/modules/gnome.py
Co-authored-by: Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
2020-06-16 08:21:35 -04:00
Xavier Claessens 0b4cf5a844 gnome: Add fatal_warnings kwarg to generate_gir()
Fixes: #7130
2020-06-16 08:21:35 -04:00
Dylan Baker 06481666f4 interpreter: Replace some uses of mlog.deprecation with FeatureDeprecated
This gives the version that the feature was deprecated in, and doesn't
print the warning if the project supports versions of meson in which the
project wasn't deprecated.
2020-05-14 11:28:04 -07:00
Xavier Claessens 93dc9cfcc3 gnome.generate_gir: Fix missing include directories
This revert a part of #7020 because it was using gir_inc_dirs
before it is set. Properly fix typelib_includes instead that was working
only when g-i is a pkgconfig dependency.
2020-05-14 17:59:17 +00:00
James Hilliard 1e073c4c1b Allow overriding g-ir-scanner and g-ir-compiler binaries.
This is useful when one needs to force meson to use wrappers for cross
compilation.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-05-07 10:19:34 -04:00
Xavier Claessens 4929547b53 gnome: Print proper error when 'nsversion' or 'namespace' are missing 2020-04-30 09:40:35 -04:00
Xavier Claessens 707d3a2e20 gnome: Fix usage of gobject-introspection as subproject 2020-04-28 14:39:59 -04:00
Jon Turney 7005e211a2 Report an errror if glib-compile-resources is missing
Produce a diagnostic if we try to use gnome.compile_resources() when
glib-compile-resources isn't present, rather than a python backtrace.
2020-03-29 20:53:50 +03:00
Xavier Claessens 326e9dcc51 gtkdoc: Add missing permitted kwarg
The 'check' kwarg was added in Meson 0.52.0.
2020-03-23 23:57:49 +02:00
Dylan Baker 06b1a317d2 Make use of unholder
We have a lot of cases of code like:
```python
if hasattr(var, 'held_object'):
    var = var.held_object`
```

replace that with the unholder function.
2020-03-05 09:58:52 -08:00
Dylan Baker 581d69a8d3 remove ability to pass multiple keys to extract_as_list
This makes the typing annotations basically impossible to get right, but
if we only have one key then it's easy. Fortunately python provides
comprehensions, so we don't even need the ability to pass multiple keys,
we can just [extract_as_list(kwargs, c) for c in ('a', 'b', 'c')] and
get the same result.
2020-03-05 09:58:52 -08:00
Dylan Baker b231ff36df Remove some uses of mesonlib.run_once
These are basically doing what mlog.log(..., once=True) does, so lets
just use that. The once argument to mlog is newer, so these probably
should have been changed already.
2020-03-05 09:31:29 -08:00
Dylan Baker a8293dd59c mesonlib: Replace unholder argument to listify
listify shouldn't be unholdering, it's a function to turn scalar values
into lists, or flatten lists. Having a separate function is clearer,
easier to understand, and can be run recursively if necessary.
2020-03-05 09:31:29 -08:00
Adam Duskett 6ba034c37d mesonbuild/modules/gnome.py: Fix giscanner and gicompiler logic
Currently, giscanner and the gicompiler paths are only scanned via pkg-config
if they are first found in the host path.

Add a else statement to fix this oversite.
2020-02-26 11:49:34 -05:00
Adam Duskett f66b04b099 gobject-introspection: determine g-ir-scanner and g-ir-compiler paths from pkgconfig
Currently, meson hard codes the paths of these binaries which results in
cross-compiled environments to run the host versions of these tools.
However, GObject-introspection provides the appropriate paths to these
utilities via pkg-config

find_program is needed in the case g-i is built as a subproject. If
g-ir-scanner or g-ir-compiler are in the build or source directory use those.
If they aren't found in the source directory, use the results from pkg-config.
2020-02-25 20:16:44 -05:00
Dylan Baker cd895be99a dependencies: Add ability to set arbitrary variables on
declare_dependencies

This allows dependencies declared in subprojects to set variables, and
for those variables to be accessed via the get_variable method, just
like those from pkg-config and cmake. This makes it easier to use
projects from subprojects in a polymorphic manner, lowering the
distinction between a subproject and an external dependency every
further.
2020-01-09 11:02:17 -08:00
Wolfgang Stöggl f037e7ef45 Fix typos found by codespell
- Typos were found by codespell v1.16.0
2019-11-06 09:55:30 -05: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
Aleksey Gurtovoy 75daed27bc mesonlib.split_args/quote_arg/join_args 2019-09-05 23:42:47 +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
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
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
Alexander Kanavin ecbfc08dca gnome.py: correctly pick the compiler for gtk-doc builds 2019-06-27 09:17:49 -07: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
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
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
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 5dc613d618 Revert "gnome.compile_resources: Add ld binary method"
This reverts commit 59791fc569, reversing
changes made to e26b5a119e.
2019-03-28 23:23:01 +02:00
Ninja-Koala 1a986c90eb Fix #5046 2019-03-17 19:26:11 +02:00
Jussi Pakkanen 902aaf2ce6
Merge pull request #4626 from Ericson2314/consolidate-properties
Go through coreutils.compiler_options.{build.host.target}
2019-02-04 23:06:46 +01:00
Ninja-Koala 4775dd48a6
Fix required version 2019-02-03 13:14:36 +01:00
Ninja-Koala 0601895032
More robust name generation 2019-02-03 11:49:40 +01:00
Ninja-Koala b0832c8747
Move some additional functionality into the new function 2019-02-02 23:02:33 +01:00
John Ericson 19f81d3e33 Never access environment.properties downstream
Instead use coredata.compiler_options.<machine>. This brings the cross
and native code paths closer together, since both now use that.

Command line options are interpreted just as before, for backwards
compatibility. This does introduce some funny conditionals. In the
future, I'd like to change the interpretation of command line options so

 - The logic is cross-agnostic, i.e. there are no conditions affected by
   `is_cross_build()`.

 - Compiler args for both the build and host machines can always be
   controlled by the command line.

 - Compiler args for both machines can always be controlled separately.
2019-02-02 13:59:14 -05:00
Ninja-Koala 34191ec018
Use triple quote string for linkerscript 2019-02-02 19:46:32 +01:00
Ninja-Koala 83d78d7b6e
Move target generation in new function 2019-02-02 19:45:48 +01:00
Ninja-Koala b6a6076596
Disable for cross builds 2019-02-02 19:07:06 +01:00
Ninja-Koala 6026a35446
Handle minus sign correctly 2019-02-01 22:02:20 +01:00
Ninja-Koala 1f14a58d3b
Add second dependency file for c target 2019-02-01 22:02:20 +01:00
Ninja-Koala a6f09b9754
Remove dependency file from c target 2019-02-01 22:02:20 +01:00
Ninja-Koala 27edd112e2
Fix code formatting 2019-02-01 22:02:20 +01:00
Ninja-Koala b4f04a67de
gnome.compile_resources: Add ld binary method
Instead of generating a c file that gets compiled,
directly create object file with ld.

See https://gitlab.gnome.org/GNOME/glib/issues/1489
2019-02-01 22:02:19 +01:00
Elliott Sales de Andrade 52936e4a46 Add tsan and ubsan to g-ir-scanner workaround.
Both of these need to link to their respective libraries to build.
2019-01-31 22:11:18 +02:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05:00