Commit Graph

12621 Commits

Author SHA1 Message Date
Florian "sp1rit"​ ad8f24f232 Implement `preserve_path` for install_headers
The `install_headers` function now has an optional argument
`preserve_path` that allows installing multi-directory
headerfile structures that live alongside sourcecode with a
single command.

For example, the headerfile structure

headers = [
  'one.h',
  'two.h',
  'alpha/one.h',
  'alpha/two.h',
  'alpha/three.h'
  'beta/one.h'
]

can now be passed to `install_headers(headers, subdir: 'mylib', preserve_path: true)`
and the resulting directory tree will look like

{prefix}
└── include
    └── mylib
        ├── alpha
        │   ├── one.h
        │   ├── two.h
        │   └── three.h
        ├── beta
        │   └── one.h
        ├── one.h
        └── two.h

Fixes #3371
2022-05-30 18:03:01 -04:00
Eli Schwartz 37fea63033 fix invalid type for default_options
We have two checks for the type accepted here. One is the basic
typed_kwargs type-checking, which declares it accepts:

  str | include_directories

The other is the custom validator which further narrows it to strings
with certain option-like properties (needs to be an = assignment).

The former is obviously wrong, which doesn't really matter all that much
but still isn't very nice...

Introduced in commit f34013fb08.
2022-05-30 12:26:19 -04:00
Eli Schwartz 194c28297f fix incorrectly allowed kwarg for custom_target
override_options makes no sense for custom_target as we don't use it for
anything. Also, this was added in commit c3c30d4b06
despite not being allowed in permittedKwargsc3c30d4b0.

For inexplicable reasons, we had a known_kwargs for custom_target that
looped over kwargs and issued a warning, not an error, for unknown
kwargs. It was impossible to ever hit that check to begin with, though,
ever since commit e08d735105 which added
permittedKwargs and obsoleted those manual checks with real errors.

So at one point override_options was specially permitted to be used
without emitting a warning, and then for about half a decade it was an
error, and then based on some dead code it was allowed again for a bit.
But through all this it doesn't do anything and isn't documented.
2022-05-30 12:26:19 -04:00
Eli Schwartz 915a468ed3
i18n: be build-compatible (but not developer-compatible) with gettext-tiny
For maintainer targets, we need some more tools that gettext-tiny
doesn't implement. It's a shame to cause NLS to be completely disabled
in such environments, so instead just issue a warning and continue.

Before 0.62.0 these were never checked for, and would simply fail at
runtime, probably. In theory, the user might install the tools in
between configuring and building, and then the maintainer targets would
begin to work. Return to that behavior -- we still create the targets,
which will *probably* fail, but might not -- and for existing
integrations, failing at `ninja foo-update-po` with "error, program
msgmerge not found" is a bit more discoverable than ninja saying "what
do you mean, there's no such target".

We still have the 0.62.0 preferred behavior of trying to find the
programs, succeeding in all cases other than gettext-tiny, and
guaranteeing that their paths are set up in a machine-file-respecting
manner.
2022-05-29 18:23:03 -04:00
Eli Schwartz de2c091ba6
i18n: fix bug where disabling gettext() broke merge_file()
In the former case, the presence of tools is optional, but triggers a
warning and then no-ops the target. In the latter case, the presence of
the tools is mandatory. But if it was already looked up and discovered
to be missing, we did not actually check that it is found before trying
to use it.

In the case that it isn't found, check again, so that we explicitly
error out with a relevant error message due to setting the required
flag.

Fixes #10320
2022-05-29 18:23:03 -04:00
Eli Schwartz 34da721ec2
gettext: explicitly pass source root / subdir as cli args
Because this is a wrapper script and we could/should do this, we even
have half the infra for it.
2022-05-29 18:23:03 -04:00
Eli Schwartz 6757e4f07c
linkers: try a bit harder to autodetect the correct linker id
mingw GCC using ld.bfd emits diagnostics that include
"-plugin-opt=-pass-through=-lmoldname" and this triggers a match for
mold when it should not.

Instead, always check the very beginning of the output for the linker
id. This is pretty consistent:

- it is always on stdout

- GCC may put additional things on stderr we don't care about

- swift is bizarre and on some OSes redirects the linker stdout to
  swiftc's stderr, but it will still be the only stderr; we didn't even
  check stderr at all until commit 712cbe0568

For gold/bfd linkers, the linker id is always the *second* word, after
the legally mandated "GNU" we already check for.
2022-05-29 11:41:55 -04:00
Guilherme Janczak 704cd1a79d remove repetition and stiff language 2022-05-26 20:48:47 -04:00
Guilherme Janczak 3c66be0c1d don't tell documentation contributors to skip CI
The CI correctly handles documentation changes automatically, it's no
longer necessary to do it by hand.
2022-05-26 20:47:39 -04:00
Eli Schwartz fda4c49c34
fix custom_target crash if boolean true is specified in install_dir
We accept boolean false to indicate "do not install this one particular
output", but the type checking simply checked if it is a bool. We do
this correctly for configure_file, so copy the same validator from
there.
2022-05-26 17:42:14 -04:00
Xavier Claessens 9b9154017e Make a copy of auto_features options when changing its name
This fixes bogus messages "skipped: feature foo disabled" when
auto_features=disabled. It was reporting the name of the latest
get_option() call instead of the name of the current feature option.

This is especially visible in GStreamer summary where it should show a
different option name for every subproject but instead shows "tools"
everywhere:
```
  Subprojects
    gst-devtools              : NO Feature 'tools' disabled
    gst-editing-services      : NO Feature 'tools' disabled
    ...
```
2022-05-25 22:52:30 -04:00
Dylan Baker a6df51aa8c build: replace hand rolled code with CustomTarget[Index].links_dynamically()
Which also fixes builds on windows that might produce a .lib instead of
a .a. The error message has been changed to reflect that as well
2022-05-25 22:41:03 -04:00
Dylan Baker 8f68f5435d interpreter: add type restrictions to declare_dependency link_whole
Including that we don't accept SharedLibraries or CustomTarget[Index]s
that are a shared library
2022-05-25 22:41:03 -04:00
Dylan Baker bd68e8c613 build: Add a `links_dynamically` method to CustomTarget[Index]
This is useful for cases where we treat CustomTargets as linkable
targets, and need to know whether they're going to link statically or
dynamically.
2022-05-25 22:41:03 -04:00
Dylan Baker 702030a9cc dependencies: Don't allow as_link_whole to complete with SharedLibraries
Since a SharedLibrary can't be statically linked in, we shouldn't allow
the method to complete.
2022-05-25 22:41:03 -04:00
Dylan Baker 5926190cbb interpreter: add annotations to extract_variables 2022-05-25 22:41:03 -04:00
Dylan Baker 835a697da0 dependencies: Fix several annotations issues
- `BuildTarget` should be `SharedLibrary | StaticLibrary`
- Needs to take `CustomTargetIndex` as well as `CustomTarget`
- don't assign to self until values have been converted to the correct
  type
2022-05-25 22:41:03 -04:00
Dylan Baker 6e36f8f666 build: fix annotations for BuildTarget.link*target
which do not hold BuildTargets, they are `SharedLibrary | StaticLibrary |
CustomTarget | CustomTargetIndex` (whole doesn't accept `SharedLIbrary`)
2022-05-25 22:41:03 -04:00
Dylan Baker 9c9be9d74b modules/gnome: Fix missing type annotation 2022-05-25 22:41:03 -04:00
Dylan Baker 764b3bf327 modules/gnome: fix some typing issues
That come to light with some of the changes later in this series,
particularly around dependencies.
2022-05-25 22:41:03 -04:00
Andreas Obergschwandtner bfc4e958b4 Fix optimization level 's' for the TI compiler 2022-05-25 07:12:02 -07:00
Daniel Mensinger 35b3522065 cmake: Add test case 2022-05-24 18:00:49 -04:00
Daniel Mensinger ac31eb49d6 cmake: fix detecting directories as input files (fixes #10244) 2022-05-24 18:00:49 -04:00
Daniel Mensinger 7ef73e8f6a ast: cmake: Generate line numbers while printing the AST for better debugging 2022-05-24 18:00:49 -04:00
Xavier Claessens c88c1e7dba doc: Generate dev release notes 2022-05-24 20:19:46 +03:00
andy5995 5746469e45 Compiler-properties.md:link to compiler object page 2022-05-24 20:18:42 +03:00
Peter Eisentraut 8e4fecdd0f Tweak "header has symbol" message
Change message

    Header <foo.h> has symbol "BAR"

to

    Header "foo.h" has symbol "BAR"

with the first part also now in bold.  This is more consistent with
other messages like

    Has header "foo.h"

and

    Checking whether type "foo" has member "bar"
2022-05-24 20:18:19 +03:00
Eli Schwartz 950fd06bc3 fix traceback when run_command has a find_program as the inline arg
We were poking directly at the node, so if it was a FunctionNode then
this broke. Instead, just do a reverse lookup in the overrides table to
get the original find_program name.
2022-05-24 20:16:16 +03:00
Paolo Bonzini a7e458effa mtest: ignore invalid input
TAP version 14 introduced subtests, that are supposedly backward compatible
because "TAP13 specifies that non-TAP output should be ignored".  Meson
reported TAP syntax errors based on behavior of "prove" at the time,
but it seems that now "prove" has become a lot more lenient; it even
accepts the following completely bogus input just fine:

---
ok 1
    ok 2
x
1..1
---

So do the same and make Meson's parser accept invalid TAP input silently.

Fixes: #10032
2022-05-24 20:15:34 +03:00
Dylan Baker 4acab57d47 modules/icestorm: use type checking 2022-05-23 23:32:47 -04:00
Dylan Baker 02ac3d7b2e modules/icestorm: replace individual tools attributes with dict
As we commonly do in other modules
2022-05-23 23:32:47 -04:00
Dylan Baker d97d3721a3 interpreter: Add another overload to source_strings_to_files
Which doesn't have `StructuredSources`, as is actually quite common.
2022-05-23 23:32:47 -04:00
Dylan Baker 10fc19ecb4 modules: add typing to the modtest module 2022-05-23 23:32:47 -04:00
Eli Schwartz 1c52ac4e15
move various imports into TYPE_CHECKING blocks for neatness 2022-05-23 16:44:08 -04:00
Eli Schwartz e5c7dc199a
typing: use forward reference for types defined later in file 2022-05-23 16:44:07 -04:00
Eli Schwartz 9b17dd4f56
fix typing regression
In commit f2d21bf8a9 a type annotation was
added that does not exist. The referenced type is present but only as a
dotted name.
2022-05-23 16:44:07 -04:00
Tristan Partin 5d0538d235 Fix invalid Python overrides
- mismatched method type
- mismatched parameter names
2022-05-19 15:05:53 -04:00
Tristan Partin 8d918e0147 Add cc.has_function_attribute('sentinel') 2022-05-19 15:05:53 -04:00
Tristan Partin 5d438b6aed Add cc.has_function_attribute('section') 2022-05-19 15:05:53 -04: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
Zbigniew Jędrzejewski-Szmek 087e7943d0 Reword misleading warning
"tried to use" implies that the attempt was not successful, i.e. that meson
ignored the feature. But that is not what happens, apart from the warning the
feature works just fine. The new message is also shorter ;)
2022-05-19 07:18:43 -04:00
Tristan Partin 153e81a816 Fix --allow-shlib-undefined for LLVM versions > 9 2022-05-18 22:44:17 -04:00
Eli Schwartz cf86b2f9a1
fix incorrect FeatureNew for separator kwarg in environment object methods
In commit 6acfe48f32, the kwarg was added
to environment() in addition to the env object methods. As part of the
associated refactor, a shared KwargInfo was used, and evolved to be new
since 0.62.0 in the two cases where it is in fact new.

However, it *also* set the base KwargInfo for the exact same newness,
which is wrong as it was present ever since the initial introduction in
0.34.0

As usual for anything that predates 0.37.0 we simply don't tag
FeatureNew. Revert this back to the same KwargInfo definition from
before the refactoring commit.

Fixes #10402
2022-05-17 16:54:16 -04:00
Eli Schwartz 9fe18a63b1 mtest: stop disrespecting the gdb config file
This was added in commit 01be50fdd9 with
zero explanation as a side effect of moving code around. It seems like a
really bad idea and it causes people to view debugging Meson projects on
e.g. debuginfod systems as "painful".
2022-05-17 22:54:53 +03:00
Adel Kara Slimane 459970b55f Update Creating-OSX-packages.md
Qt offers a tool to automatize most of what needs to be done regarding its libraries.
2022-05-16 20:45:30 +03:00
joshcangit 3e26c0f1ca Add optional compress
Compress files under source directory using Deflate method.
By default, files are not compressed in the archive.
Compression is active only when this option is defined.

https://docs.python.org/3/library/zipapp.html?highlight=zipapp#cmdoption-zipapp-c
2022-05-16 12:17:24 -04:00
Lens b1abda2b4b linkers/MinGW: Allow `efi_application` value for `win_subsystem`
Previously, any value other than `windows` or `console` caused an
exception. This change allows for `efi_application` to be passed as
the `win_subsystem` to MinGW based linkers.
2022-05-10 17:45:24 -04:00
Simon McVittie 65ea833d58 Require CMake 3.14 for all tests that use the cmake module
Older versions are not supported by the cmake module since 0.62.

This avoids having to hard-code the linux-bionic-gcc CI job as being
unable to run these tests, which leaves other older environments like
Debian 10 still trying to run them (and failing).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-10 07:56:59 -04:00
fghzxm 7650f32828 dependencies/boost.py: ignore unknown files
If we encounter a file under the Boost library directory that doesn't
look like a Boost library binary, we should ignore it.

We log a warning for each file we ignore, except for ones we know are
safe to ignore (e. g. PDB files from the SourceForge Windows
distribution).  This should avoid polluting the log.

Fixes #8325.
2022-05-09 21:42:02 +02:00
Eli Schwartz aa874ea0d0 python module: default extensions to hidden symbol visibility
python compiled extensions should never need to expose any symbol other
than PyInit_* which is declared with default visibility via
PyMODINIT_FUNC on supported compilers.

Thus, a reasonably sane default is to mark any other symbols as hidden,
while still respecting any manually specified visibility.

Gate this on the version of python itself, as not all versions decorate
PyMODINIT_FUNC properly.
2022-05-09 10:49:04 -04:00