Commit Graph

10 Commits

Author SHA1 Message Date
Joel Rosdahl 631cce71db Fail gracefully when compiler cache is specified without compiler
With

    CC=ccache meson ...

meson crashes with

    [...]
      File "/usr/lib/python3.10/site-packages/mesonbuild/compilers/detect.py", line 364, in _detect_c_or_cpp_compiler
        compiler_name = os.path.basename(compiler[0])
    IndexError: list index out of range

Improve this by throwing an EnvironmentException to fail gracefully when
no compiler is specified.

Fixes #9933
Fixes #13589
2024-12-31 10:36:11 -05:00
Nirbheek Chauhan 0f914b75fe programs: Allow excluding certain paths when searching in PATH 2024-10-04 05:38:40 +05:30
Dylan Baker e991c4d454 Use SPDX-License-Identifier consistently
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.

This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.

SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
2023-12-13 15:19:21 -05:00
Xavier Claessens dec85c41a9 Remove get_configtool_variable()
This also makes it more consistent with get_pkgconfig_variable() which
always return empty value instead of failing when the variable does not
exist. Linking that to self.required makes no sense and was never
documented any way.
2023-09-18 13:51:27 -04:00
Xavier Claessens 30d7f506c7 Remove get_pkgconfig_variable()
Make sure that pkgconfig_define is a pair of strings and not a list with
more than 2 strings.
2023-09-18 13:51:27 -04:00
Dylan Baker 4a014d1724 Add support for meson.options as a replacement for meson_options.txt
We will still try to load `meson_options.txt` if `meson.options` doesn't
exist. Because there are some advantages to using `meson.options` even
with older versions of meson (such as better text editor handling)
we will not warn about the existence of a `meson.options` file if a
`meson_options.txt` file or symlink also exists.

The name `meson.options` was picked instead of alternative proposals,
such as `meson_options.build` for a couple of reasons:

  1. meson.options is shorter
  2. While the syntax is the same, only the `option()` function may be
     called in meson.options, while, it may not be called in meson.build
  3. While the two files share a syntax and elementary types (strings,
     arrays, etc), they have different purposes: `meson.build` declares
     build targets, `meson.options` declares options. This is similar to
     the difference between C's `.c` and `.h` extensions.

As an implementation detail `Interpreter.option_file` has been removed,
as it is used exactly once, in the `project()` call to read the options,
and we can just calculate it there and not store it.

Fixes: #11176
2023-03-28 15:01:10 +03:00
Zbigniew Jędrzejewski-Szmek 8afdecb039 Reword message in warning
"targetting" is verb-derived adjective, which sort-of-works here, but
makes the whole sentence awkward, because there's no verb. Let's just
use present simple.
2022-05-19 07:18:43 -04:00
Dylan Baker cc8018744d tests: replace python2 framework with metal
The bundled python is deprecated, metal is unlikely to be deprecated any
time soon, so let's use that.
2021-11-18 16:55:14 -05:00
Eli Schwartz 59d4f771d2
editorconfig: add setting to trim trailing whitespace
and clean up all outstanding issues

Skip 'test cases/common/141 special characters/meson.build' since it
intentionally uses trailing newlines.
2021-08-15 09:36:18 -04:00
Xavier Claessens 7eb4c23156 Split run_unittests.py file 2021-07-26 15:19:13 -04:00