aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2022-05-23modules: add typing to the modtest moduleDylan Baker1-5/+16
2022-05-23move various imports into TYPE_CHECKING blocks for neatnessEli Schwartz6-16/+29
2022-05-23typing: use forward reference for types defined later in fileEli Schwartz1-2/+2
2022-05-23fix typing regressionEli Schwartz1-1/+1
In commit f2d21bf8a98fe4eb528a077f3faf5d68cd35c244 a type annotation was added that does not exist. The referenced type is present but only as a dotted name.
2022-05-19Fix invalid Python overridesTristan Partin3-10/+6
- mismatched method type - mismatched parameter names
2022-05-19Add cc.has_function_attribute('sentinel')Tristan Partin1-0/+2
2022-05-19Add cc.has_function_attribute('section')Tristan Partin1-0/+6
2022-05-19Reword message in warningZbigniew Jędrzejewski-Szmek1-2/+2
"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-19Reword misleading warningZbigniew Jędrzejewski-Szmek1-2/+2
"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-18Fix --allow-shlib-undefined for LLVM versions > 9Tristan Partin1-1/+2
2022-05-17fix incorrect FeatureNew for separator kwarg in environment object methodsEli Schwartz1-1/+1
In commit 6acfe48f32110671a0adf80ad3497a35105b265d, 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-17mtest: stop disrespecting the gdb config fileEli Schwartz1-1/+1
This was added in commit 01be50fdd90851f17de5499537f10b5b62c9fb49 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-10linkers/MinGW: Allow `efi_application` value for `win_subsystem`Lens1-7/+25
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-09dependencies/boost.py: ignore unknown filesfghzxm1-2/+14
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-09python module: default extensions to hidden symbol visibilityEli Schwartz1-0/+4
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-09compilers/gnu: demote visibilty inlineshidden to hidden for unsupported ↵Eli Schwartz1-0/+2
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-08fix regression in reporting errors for invalid gnu_symbol_visibilityEli Schwartz1-1/+1
In commit fb2cdd0fe2797b30e1fd4c118407302402739a3b 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-08compilers/c++: Add MSVC option to make the __cplusplus define accurateEli Schwartz1-0/+10
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 0b97d585480e973d8b149618901f7a4ddfa1a906 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-06compiler.has_argument: Add `-Werror=unknown-warning-option` to clang-cl cmd lineKhairul Azhar Kasmiran1-1/+1
2022-05-06devenv: Set WINEPATH when cross compiling for WindowsXavier Claessens2-6/+64
2022-05-06coverage: be clever and detect config files for gcovr/lcovEli Schwartz1-13/+28
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-06Add some scaffolding needed for C++ modules in GCC.Jussi Pakkanen1-0/+2
Further work pending GCC bug #105467 and/or Ninja bug #1962.
2022-05-05minit: refuse to allow creating broken projectsEli Schwartz1-0/+4
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-03add prefer_static built-in optionDudemanguy7-7/+17
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-03dependencies: cleanup kwargs.get('static') usageDudemanguy2-3/+2
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-03dependencies: handle one more case of subproject installed filesEli Schwartz1-1/+1
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-04devenv: Use PkgConfigDependency.get_env()Xavier Claessens2-5/+3
This ensures that PKG_CONFIG_PATH, PKG_CONFIG_LIBDIR and PKG_CONFIG_SYSROOT_DIR are also set properly.
2022-05-03interpreter: new function add_project_dependencies()Paolo Bonzini3-0/+29
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-03dependencies: extract code to get all leaf dependenciesPaolo Bonzini3-16/+20
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-03interpreter: simplify checks in declare_dependencyPaolo Bonzini1-5/+3
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-01use shared implementation to convert files() strings to File objectsEli Schwartz1-1/+1
This handles various edge cases: - checks for sandbox violations just like all other functions - warn for direntry issues - check for generated files referred to via strings instead of the returned object (All valid use cases for wanting to sneak around the checks, are made to work via commit bba588d8b03a9125bf5c4faaad31b70d39242b68.)
2022-05-02Windows: Improve Python 3.8+ module check on WindowsChun-wei Fan1-1/+13
On Python 3.8.x and later, if the imported module requires non-system DLLs that are not installed nor bundled with the module package, os.add_dll_directory() must be called on every path that contains the required DLLs, so that the module can be imported successfully by Python. Make things easier for people by calling os.add_dll_directory() on the valid directories in %PATH%, so that such module checks can be carried out successfully with much less manual intervention.
2022-05-01mcompile: Print suggestions when target is ambigousXavier Claessens1-1/+8
Fixes: #10221
2022-05-01cmake: Fix CMake LLVM dependency error (fixes #10322)Daniel Mensinger1-2/+9
2022-05-01Add support for multiline f-stringsPeter Lesslie2-5/+27
+ Extend the parser to recognize the multiline f-strings, which the documentation already implies will work. The syntax is like: ``` x = 'hello' y = 'world' msg = f'''This is a multiline string. Sending a message: '@x@ @y@' ''' ``` which produces: ``` This is a multiline string. Sending a message: 'hello world' ``` + Added some f-string tests cases to "62 string arithmetic" to exercise the new behavior.
2022-05-01Merge pull request #10039 from eli-schwartz/wayland-protocols-subproject-filesJussi Pakkanen8-20/+80
dependencies: allow get_variable to expose files from subprojects
2022-04-30Ignore detached head warning while cloning subprojects with tagszxey1-1/+1
2022-04-30gnome: Make sure g-ir-scanner can use pkg-config properlyXavier Claessens1-0/+8
We need to setup the environment we pass to g-ir-scanner because it will try to use pkg-config to find dependencies, and that must respect user settings from machine file. Also make it use uninstalled pc files Meson generated in the case dependencies, such as glib, have been built as subproject.
2022-04-30pkgconfig: Use EnvironmentVariables to build PKG_CONFIG_* envXavier Claessens4-25/+31
The new get_env() method that returns an EnvironmentVariables object will be needed in next commit that will pass it to CustomTarget. This has the side effect to use the proper os specific path separator instead of hardcoding `:`. It is the obvious right thing to do here, but has caused issues in the past. Hopefully issues have been fixed in the meantime. If not, better deal with fallouts than keep doing the wrong thing forever.
2022-04-30implement and test a few compiler checks for DRemi Thebault1-2/+99
- run - sizeof - alignment - has_header
2022-04-30linkers: Add support for mold linkerFini Jastrow9-49/+66
[why] Support for the relatively new mold linker is missing. If someone wants to use mold as linker `LDFLAGS="-B/path/to/mold"` has to be added instead of the usual `CC_LD=mold meson ...` or `CXX_LD=mold meson ...`. [how] Allow `mold' as linker for clang and newer GCC versions (that versions that have support). The error message can be a bit off, because it is generic for all GNU like compilers, but I guess that is ok. (i.e. 'mold' is not listed as possible linker, even if it would be possible for the given compiler.) [note] GCC Version 12.0.1 is not sufficient to say `mold` is supported. The expected release with support will be 12.1.0. On the other hand people that use the un-released 12.0.1 will probably have built it from trunk. Allowing 12.0.1 is helping bleeding edge developers to use mold in Meson already now. Fixes: #9072 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-04-30qt module: fix missing sanity check for install_dir + installEli Schwartz1-0/+2
Regression in commit 11f96380351a88059ec55f1070fdebc1b1033117. When `install: true` the install_dir must be set. The CustomTarget initializer no longer checks this for us, so we must include the check ourselves.
2022-04-30qt module: fix broken install_dir kwargEli Schwartz1-2/+1
Regression in commit 11f96380351a88059ec55f1070fdebc1b1033117. We expect exactly one string as an install_dir, but CustomTarget started expecting it to be a list. So we need to pass it as such when forwarding compile_translations() arguments to the CustomTarget initializer.
2022-04-30devenv: Catch FileNotFoundErrorXavier Claessens1-0/+2
Fixes: #10310
2022-04-27Validate setting of install_tag for CustomTargetFerdinand Thiessen1-7/+3
2022-04-27gnome: Use 'doc' install_tag for gnome.yelpFerdinand Thiessen1-4/+6
2022-04-27improve help for -DdebugPaolo Bonzini1-1/+1
"Debug" is not a very helpful help message. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-25Visual Studio: Only use /utf-8 on VS2015 or later or clang-clChun-wei Fan1-0/+4
The compiler flag only exists on Visual Studio 2015 or later, or clang-cl, and using this always can interfere with compiler feature detection when this flag is not supported. So, remove '/utf-8' from always_args if we are on Visual Studio 2013 or earlier.
2022-04-23Fix typo that breaks g++ cross detection on Debian.Jussi Pakkanen1-1/+1
2022-04-21Allow deprecating an option for a new oneXavier Claessens2-4/+18