Commit Graph

11864 Commits

Author SHA1 Message Date
Eli Schwartz ee5428d64f only pass clang LTO arguments when they are needed
If the LTO threads == 0 clang will default to the same argument we
manually pass, which meant we dropped support for admittedly ancient
versions of clang that didn't yet add that option.

Drop the extraneous argument, and add a specific error condition when
too old versions of clang are detected.

Fixes #9569
2021-11-15 22:00:53 +02:00
Jussi Pakkanen 5b08fd4b33
Merge pull request #9565 from bonzini/invalid-run-target
reject run_target in test or install script arguments
2021-11-15 22:00:21 +02:00
Dudemanguy a4b4b21908 dependencies/zlib: Add system zlib method for android
The same method that the BSDs use should also work for android. Also
update the tests and docs where appropriate.
2021-11-15 12:40:00 -05:00
Paolo Bonzini 9a8c2d23f1 interpreter: disallow RunTarget in meson.add_install_script
Without this patch, the name of the RunTarget is passed to the
install script; for the enclosed test, meson setup (incorrectly)
succeeds, but installation fails.
2021-11-15 11:33:00 +01:00
Paolo Bonzini 36c390e08e interpreter: disallow RunTarget in test
Fixes the following error in the testcase:

  File "/usr/lib/python3.10/site-packages/mesonbuild/backend/ninjabackend.py", line 548, in generate
    self.generate_tests()
  File "/usr/lib/python3.10/site-packages/mesonbuild/backend/ninjabackend.py", line 1093, in generate_tests
    self.serialize_tests()
  File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 567, in serialize_tests
    self.write_test_file(datafile)
  File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 943, in write_test_file
    self.write_test_serialisation(self.build.get_tests(), datafile)
  File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1017, in write_test_serialisation
    pickle.dump(self.create_test_serialisation(tests), datafile)
  File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1002, in create_test_serialisation
    cmd_args.append(self.construct_target_rel_path(a, t.workdir))
  File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1021, in construct_target_rel_path
    return self.get_target_filename(a)
  File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 253, in get_target_filename
    assert(isinstance(t, build.BuildTarget))
2021-11-15 11:32:59 +01:00
Eli Schwartz 680c6bb012 valac dependencies: use the canonical list of vala source names
Don't hardcode one of the three possible source types, thus ignoring the
needed vapis for dependencies using .gs or .vapi sources.

Fixes #9544
2021-11-15 15:43:43 +05:30
Dudemanguy f873b9ae2f Users.md: add mpv 2021-11-14 23:01:26 -05:00
Yasushi SHOJI dbd1e154ab interpreter: Fix a typo
This is a trivial typo.  Fix projeccts to projects.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2021-11-14 15:16:54 -05:00
Xavier Claessens 364d951b34 Share common code between clang tidy and format 2021-11-14 22:07:17 +02:00
Nathanael Gray ae3d495c37 Remove incorrect arguments for C2000 C++ compiler. Add correct form for output and include args. 2021-11-14 21:59:59 +02:00
Eli Schwartz 0bc0905210
qt module: add depfile support to moc as well
We currently enable this only for rcc (where this really really matters)
but it can often matter for moc as well, and is just generally more
correct.

Really, this should have been added in #7451 too, but I neglected it
since the module warned about inaccurate dependencies only for rcc...
2021-11-13 23:28:59 -05:00
Eli Schwartz 39ceb67774 docs: fix refman 2.0 regression in correctly describing find_library(has_headers)
All kwargs inherited from has_header need to be prefixed `header_` so we
cannot just do straight inheritance. And the part of the description
that highlighted the way kwargs are derived and evolved, went entirely
missing.

Fixes #9551
2021-11-09 16:59:36 -08:00
Eli Schwartz 4029705cf3 docs: fix some spelling typos 2021-11-09 16:59:36 -08:00
Jussi Pakkanen 96d243ac75 Delete ghwt.py as it is no longer needed or even works. 2021-11-09 14:23:54 -08:00
Jussi Pakkanen 4c1c605c57
Merge pull request #9396 from keszybz/drop-unused-and-unnecessary-printing-code
depfixer: drop unused and unnecessary printing code
2021-11-09 18:52:23 +02:00
Xavier Claessens 898bf6e518 python: Better detect when install path is not in sys.path
Using pathlib ensure propre platform specific path handling, such as
case sensitivity.
2021-11-09 18:49:03 +02:00
Zbigniew Jędrzejewski-Szmek 7a5eb6f9aa depfixer: always print the file name in messages
The messages are not useful unless we know what file they are about.
2021-11-09 10:50:59 +01:00
Zbigniew Jędrzejewski-Szmek c2f1d91b8a depfixer: convert unused printing code to debugging functions
When installing with 'meson install --quiet' I'd get the following output:
This file does not have an rpath.
This file does not have a runpath.

(It turns out that of the couple hundred of binaries that are installed,
this message was generated for /usr/lib/systemd/boot/efi/linuxx64.elf.stub.)

There doesn't seem to be any good reason for this output by default. But those
functions can still be used for debugging. Under a debugger, returning the
string is just as useful as printing it, but more flexible. So let's suppress
printing of anything by default, but keep the extractor functions.

The code was somewhat inconsistent wrt. to when .decode() was done. But it
seems that we'll get can expect a decodable text string in all cases, so
just call .decode() everywhere, because it's nicer to print decoded strings.
2021-11-09 10:50:59 +01:00
Zbigniew Jędrzejewski-Szmek da522efc93 depfixer: f-strings 2021-11-09 10:47:21 +01:00
Dylan Baker f48d75dcae compilers/java: Add no_warn_args and debug_args methods 2021-11-08 23:33:14 +02:00
rusty-snake 5af556e2b8 Fix markdown formating in find_program.yaml
fixes #9528
2021-11-05 21:03:44 +05:30
Eli Schwartz 558f9fed9e
fix regression that broke string.format with list objects
String formatting should validly assume that printing a list means
printing the list itself. Instead, something like this broke:

'one is: @0@ and two is: @1@'.format(['foo',  'bar'], ['baz'])

which would evaluate as:

'one is: foo and two is: bar'

or:

'the value of array option foobar is: @0@'.format(get_option('foobar'))

which should evaluate with '-Dfoobar=[]' as

'the value of array option foobar is: []'

But instead produced:

meson.build:7:0: ERROR: Format placeholder @0@ out of range.

Fixes #9530
2021-11-04 18:57:14 -04:00
Eli Schwartz 1104b82137 fix custom_target with install: true and no install_dir, crashing
It's supposed to emit an error message, but instead it did a traceback.
It used to be, if no install_dir was specified then it was simply not in
kwargs, but due to typed_kwargs it will now be there, but not have
viable contents, so the dict membership check got skipped.

Fixes #9522
2021-11-02 19:56:10 -07:00
Xavier Claessens d23ae8b58e wrap: Fix concurrent os.mkdir()
Since 0.59.0 Meson downloads multiple wraps in parallel, so the
packagecache directory could be created by one then the 2nd would hit
error when calling os.mkdir() because it already exists.
2021-11-02 17:27:00 -04:00
Jussi Pakkanen 53febd08cd Add tutorial for building an SDL app from scratch. 2021-11-02 21:07:38 +02:00
Xavier Claessens c8d125653d
python.dependency(): Do not stop when first candidate is not found
It has to lookup the dependency with required=False otherwise it raises
an exception when the first candidate (pkg-config) failed.
2021-11-02 14:24:08 -04:00
Dylan Baker 98a9cc079c FAQ: Add entry about `add_project_link_arguments` and multiple languages
This seems to come up fairly often, so having an FAQ entry seems useful.
2021-11-02 14:03:18 -04:00
Moroz Oleg b72624171b Move language standard in separate method within vsbackend 2021-11-02 18:50:44 +02:00
Олег Мороз 387e846568 Fixes .vcxproj for vs2017 vs2019
fixes #6314

in case of backend is vs2017 or vs2019 place LanguageStandard tag with stdcpp version and LanguageStandard_C tag with stdc version in .vcxproj file
2021-11-02 18:50:44 +02:00
Eli Schwartz 038b31e72b
various manual conversion of percent-formatted strings to f-strings 2021-11-01 20:26:18 -04:00
Eli Schwartz bae0fdf64a
fix broken error message that printed formatter codes
This was probably supposed to be percent-formatted but got typoed to a
comma instead. Rewrite as an f-string.
2021-11-01 20:22:35 -04:00
Eli Schwartz ab1741659e
fix typoed vs backend token 2021-11-01 20:22:34 -04:00
Eli Schwartz 0f0b1f22d2
coverage generator: obey the documentation and only generate supported outputs
We say:

> If version 4.2 or higher of the first is found, targets coverage-text,
> coverage-xml, coverage-sonarqube and coverage-html are generated.

But this is totally untrue. Make it true, by actually checking (and
not generating broken coverage commands when older versions of gcovr are
found).

Fixes #9505
2021-11-01 18:57:14 -04:00
Dylan Baker 86df7dd627 modules/gnome: don't use dict.keys() to test membership
This is slower than looking in the dictionary, as the dict lookup is
O(log n), while keys() is O(n).
2021-11-01 12:24:25 -07:00
Dylan Baker 83facb3959 modules/gnome: use textwrap.dedent
Python is a whitespace significant language, changing indent level
implies that scope is changing. So when a string like

```python
def foo():
    a = '''
somthing
'''
    return a
```

It's visually misleading. Couple that with folding editors like vim
getting utterly confused by this, and it turns into a real pain. Using
textwrap.dedent allows us to get rid of that:

```python
def foo():
    a = texwrap.dedent(
        '''
        something
        ''')
    return a
```

But we still get the same result
2021-11-01 12:24:25 -07:00
Dylan Baker ba85c71750 modules/gnome: use envconfig for VAPIGEN
we have a mechanism for doing "this could be an environment variable"
let's use that.
2021-11-01 12:24:25 -07:00
Dylan Baker 35bc0ad22f mesonbuild/module/gnome: remove unused variable 2021-11-01 12:24:25 -07:00
Dylan Baker 2acd22fdb5 modules/gnome: Use typed_pos_args for generate_vapi 2021-11-01 12:24:25 -07:00
Dylan Baker bfd47cdac6 modules/gnome: use typed_pos_args for genmarshal 2021-11-01 12:24:25 -07:00
Dylan Baker 4a426f3649 modules/gnome: use typed_pos_Args for mkenums_simple 2021-11-01 12:24:25 -07:00
Dylan Baker 625fbf5243 modules/gnome: use typed_pos_args for mkenums 2021-11-01 12:24:25 -07:00
Dylan Baker 53a187ba2a modules/gnome: use typed_pos_args for gdbus_codegen 2021-11-01 12:24:25 -07:00
Dylan Baker 3798423563 modules/gnome: use typed_pos_args for gtkdoc_html_dir 2021-11-01 12:24:25 -07:00
Dylan Baker 256d5a71ba modules/gnome: use typed_pos_args for gtkdoc 2021-11-01 12:24:25 -07:00
Dylan Baker 58a592c5b0 modules/gnome: use typed_pos_args for yelp 2021-11-01 12:24:25 -07:00
Dylan Baker f339c33394 modules/gnome: use noPosargs for compile_schemas 2021-11-01 12:24:25 -07:00
Dylan Baker fea24ca174 modules/gnome: use typed_pos_args for generate_gir 2021-11-01 12:24:25 -07:00
Dylan Baker 3dcc712583 modules/gnome: use typed_pos_args for compile_resources 2021-11-01 12:24:25 -07:00
Dylan Baker 31efad6016 modules/gnome: add some type annotations
This is not complete, but it's a start. The rest will have to get
finished as we go
2021-11-01 12:24:25 -07:00
Dylan Baker 34d3e383ec modules/gnome: clean and sort dependencies 2021-11-01 12:24:25 -07:00