Commit Graph

12599 Commits

Author SHA1 Message Date
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
Eli Schwartz 7c4087ace5 compilers/gnu: demote visibilty inlineshidden to hidden for unsupported compilers
This option is only valid for C++ and ObjC++, but the kwarg is useful
for mixed language targets. Asking for inlines as well, when the
compiler driver is trying to build the C components of a target, results
in gcc emitting:

```
cc1: warning: command-line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C
```

Squelch this warning by filtering it out on Meson's side of things.
2022-05-09 10:49:04 -04:00
Eli Schwartz d6e3517e0d
fix regression in reporting errors for invalid gnu_symbol_visibility
In commit fb2cdd0fe2 the internal property
was renamed, but one use case of it in raising a MesonException was not
changed to go with it.

This meant that instead of erroring out with:

```
ERROR: GNU symbol visibility arg XXXX not one of: default, internal, hidden, protected, inlineshidden
```

we instead errored out with:
```
AttributeError: 'SharedLibrary' object has no attribute 'symbol_visibility'
```

Fixes #9659
2022-05-08 14:43:29 -04:00
Eli Schwartz 04c728a126 compilers/c++: Add MSVC option to make the __cplusplus define accurate
Otherwise it always returns the value for c++98, starting with MSVC 2017
15.7 or later. Earlier versions are not affected by this mis-feature.

See: https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160

This was originally applied as 0b97d58548
but later reverted because it made the CI red. Try it again, now.

Original-patch-by: Dylan Baker <dylan@pnwbakers.com>
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2022-05-08 14:40:54 -04:00
Jussi Pakkanen 3ae36dee42 Limit parallelism to hopefully work on machines with 160 cores. 2022-05-06 16:37:36 -04:00
Khairul Azhar Kasmiran 6b7bc608b7 compiler.has_argument: Add `-Werror=unknown-warning-option` to clang-cl cmd line 2022-05-06 23:09:52 +03:00
Xavier Claessens f9200ca8f7 devenv: Set WINEPATH when cross compiling for Windows 2022-05-06 23:04:11 +03:00
Eli Schwartz 1e4d4fce22 coverage: be clever and detect config files for gcovr/lcov
gcovr will read this file anyway, but if it exists we don't need to
assume that the project wishes to exclude subprojects/ -- they can
determine that themselves.

Fixes #3287
Closes #9761

lcov doesn't read the config file by default, but we can do the smart
thing here.

Fixes #4628
2022-05-06 22:55:37 +03:00
Jussi Pakkanen eef51fa3d6 Add some scaffolding needed for C++ modules in GCC.
Further work pending GCC bug #105467 and/or Ninja bug #1962.
2022-05-06 18:48:15 +03:00
Jussi Pakkanen 7183d9d71e Move Visual Studio module test to its own subdir. 2022-05-06 18:48:15 +03:00
Simon McVittie 42327eacbc unittests: Skip prelinking test with gcc 8 or older
This was already skipped when running on the Ubuntu 18.04 version of gcc,
but it also fails with gcc 8.3.0 on Debian 10. Instead of hard-coding
specific versions to look for, do a version comparison.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-06 07:49:32 -04:00
Eli Schwartz 09a2603285
minit: refuse to allow creating broken projects
Some executable names are invalid, and while it's unlikely anyone will
specify such a thing using the --executable argument, it's not unlikely
that people experimenting will attempt to use meson init in a directory
named "test".

This then defaults to that for both the project name and the sample
target name, and the latter produces errors when you try to build it.

Fixes #10321
2022-05-05 20:07:44 -04:00
Dudemanguy 557680f7d6 add prefer_static built-in option
By default, meson will try to look for shared libraries first before
static ones. In the meson.build itself, one can use the static keyword
to control if a static library will be tried first but there's no simple
way for an end user performing a build to switch back and forth at will.
Let's cover this usecase by adding an option that allows a user to
specify if they want dependency lookups to try static or shared
libraries first. The writer of the meson.build can manually specify the
static keyword where appropriate which will override the value of this
option.
2022-05-03 23:03:56 -04:00
Dudemanguy 8b3a54e508 dependencies: cleanup kwargs.get('static') usage
In a couple of spots, kwargs.get('static', False) was being
unneccesarily used. In these spots, we can just use self.static instead
which is already inherited from the ExternalDependency. In additional,
the python system dependency oddly has a kwargs.get('static', False)
line which overrides the self.static in that dependency for no real
reason. Delete this line too.
2022-05-03 23:03:56 -04:00
Eli Schwartz 6c0370f62f
dependencies: handle one more case of subproject installed files
Some projects treat meson.project_source_root() as the root of the
dependency files, because the project itself merely wraps a bunch of
datafiles. Our validation to make sure this doesn't point to another
subproject, made use of pathlib.Path's generator for all component
paths, which... did not include the path itself. So go ahead and
explicitly check that too. Add a test case to verify it while we are at
it.

Fixes https://github.com/mesonbuild/meson/pull/10103#issuecomment-1114901033
2022-05-03 18:43:07 -04:00
Xavier Claessens 5a34dcedf7 devenv: Use PkgConfigDependency.get_env()
This ensures that PKG_CONFIG_PATH, PKG_CONFIG_LIBDIR and
PKG_CONFIG_SYSROOT_DIR are also set properly.
2022-05-04 00:16:32 +03:00
Paolo Bonzini 2f68aa21e8 add testcase for bad things with add_project_dependencies
Test that add_project_dependencies() can only be used before build targets
have been declared.  Also test that one cannot use override_dependency
on a superproject to inject a superproject's build products into the
subproject.  This would violate the rule that build products cannot be used
with add_project_dependencies() (similar to e.g. compiler.has_function),
so check that meson detects the situation correctly.
2022-05-03 02:00:29 -04:00
Paolo Bonzini 3a960023d3 interpreter: new function add_project_dependencies()
This function can be used to add fundamental dependencies such as glib
to all build products in one fell swoop.  This can be useful whenever,
due to a project's coding conventions, it is not really possible to
compile any source file without including the dependency.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-03 02:00:29 -04:00
Paolo Bonzini 06b76f7c9d dependencies: extract code to get all leaf dependencies
Extract to a separate function the code that resolves dependencies
for compiler methods.  We will reuse it for add_project_dependencies().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-03 02:00:29 -04:00
Paolo Bonzini d413dedf2a interpreter: simplify checks in declare_dependency
Both dependencies.ExternalLibrary and dependencies.InternalDependency are
subclasses of dependencies.Dependency, no need to list them separately.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-03 02:00:29 -04:00
Remi Thebault d7e56f5ec9 complete documentation of declare_dependency 2022-05-02 23:06:38 +03:00
Remi Thebault 0f15bfb846 Fix wrong name in doc
The doc about declare_dependency states
d_module_features instead of d_module_versions
2022-05-02 23:06:38 +03:00
Eli Schwartz 5c0145c54d
docs: correct incorrect types for pch files
In the original RefMan 2.0 implementation, the types for this were
filled in as `str | file`, but the code only ever accepted the former.
Fix the documentation so that it aligns with reality.

Fixes #10338
2022-05-02 00:20:10 -04:00