aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
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
2022-04-21gtkdochelper.py: Use os.pathsep for --path argumentChun-wei Fan1-1/+1
This way, we can ensure that gtk-doc parses the --path argument correctly when passed in from the cmd.exe console, since ':' is normally used to denote that a drive is being used on local paths.
2022-04-20vcs_tag: handle non-str / non-file argumentsKirill Isakov1-5/+8
This makes vcs_tag behave like other commands so it accepts not only string and file arguments, but also exe, custom_tgt, and external_program.
2022-04-20vcs_tag: document the already supported file argKirill Isakov1-0/+2
2022-04-20Add NetBSD support in symbolextractor.Thomas Klausner1-0/+2
Choose FreeBSD backend (OpenBSD backend would also work).
2022-04-19pkgconfig: Add relocatable module optionFredrik Salomonsson2-2/+18
If set to true it will generate the pkgconfig files as relocatable i.e the prefix variable will be relative to the install_dir. By default this is false. Will generate a MesonException if the pkgconfig file is installed outside of the package and pkgconfig.relocatable=true.
2022-04-19Add ppc970 definition to universal.pySergey Fedorov1-0/+1
2022-04-19Fix universal builds on Darwin PPC: add ppc7400 definitionbarracuda1561-0/+1
2022-04-18Fix generator expression list problems (fixes #10288)Daniel Mensinger1-6/+7
2022-04-14simplify destdir_join for readabilityEli Schwartz1-3/+3
We can immediately short-circuit if there is no destdir, as we simply return the prefix unchanged. If there is some kind of destdir and the prefix contains a drive letter, then no matter what we need to remove the drive letter before joining. Technically, if the destdir is a relative path e.g. `destdir\` and `C:\prefix`, we should still install to `destdir\prefix` without the drive letter. But... we also guarantee that destdir is an absolute path (or empty) anyway. And even if we didn't, non-absolute destdir is a broken concept for a variety of complicated reasons. So none of this matters in practice. One way or another, we don't need to actually check whether destdir is an absolute path before cutting off the prefix drive letter.
2022-04-14qt module: move comment to the correct location after refactoringEli Schwartz1-2/+2
In commit f291b637b13ba32e20d1081906e68780d2a5ae5a the tools were moved around but a comment got forgotten. Now, in order to be meaningful and remind us of anything, it needs to be in a different location.
2022-04-14typoEli Schwartz1-1/+1
2022-04-14remove useless conditionEli Schwartz1-1/+0
not is_subproject() is the same check as self.subproject == ''
2022-04-14pyupgrade --py37-plusEli Schwartz3-13/+5
Some more old style code crept in again. Additionally, pyupgrade learned to catch more if/elsed code based on the python version, and delete it.
2022-04-14Fix typo in commentBen Brown1-1/+1
2022-04-13dependencies: move DependencyVariableString handling to declare_dependencyEli Schwartz3-7/+22
This allows tracking which subproject it came from at the time of definition, rather than the time of use. As a result, it is no longer possible for one subproject which knows that another subproject installs some data files, to expose those data files via its own declare_dependency.
2022-04-13dependencies: allow get_variable to expose files from subprojectsEli Schwartz4-4/+49
There are somewhat common, reasonable and legitimate use cases for a dependency to provide data files installed to /usr which are used as command inputs. When getting a dependency from a subproject, however, the attempt to directly construct an input file from a subproject results in a sandbox violation. This means not all dependencies can be wrapped as a subproject. One example is wayland-protocols XML files which get scanned and used to produce C source files. Teach Meson to recognize when a string path is the result of fetching a dep.get_variable(), and special case this to be exempt from subproject violations. A requirement of this is that the file must be installed by install_data() or install_subdir() because otherwise it is not actually representative of what a pkg-config dependency would provide.
2022-04-13dependencies: tighten type checking and fix cmake API violation for get_variableEli Schwartz5-18/+18
dep.get_variable() only supports string values for pkg-config and config-tool, because those interfaces use text communication, and internal variables (from declare_dependency) operate the same way. CMake had an oddity, where get_variable doesn't document that it allows list values but apparently it miiiiiight work? Actually getting that kind of result would be dangerously inconsistent though. Also, CMake does not support lists so it's a lie. Strings that are *treated* as lists with `;` splitting don't count... We could do two things here: - raise an error - treat it as a string and return a string It's not clear what the use case of get_variable() on a maybe-list is, and should probably be a hard error. But that's controversial, so instead we just return the original `;`-delimited string. It is probably the wrong thing, but users are welcome to cope with that somehow on their own.
2022-04-13wayland: Make sure wayland-scanner has same version as wayland librariesXavier Claessens1-1/+6
2022-04-13compilers: fix broken CompCert support for release flagsEli Schwartz1-1/+1
This has been broken ever since the original implementation. Due to a typo, the optimization flag used a zero instead of an uppercase "o", which the compiler then breaks on during argument parsing because it is an invalid argument. Fixes #10267
2022-04-13mconf: Fix printing <inherited from main project> for yielding optionsXavier Claessens1-13/+9
In print_options() k was a string instead of OptionKey, but self.yielding_options expects OptionKey. Not sure how this has not been catched by mypy. Fix by keeping k as OptionKey which makes self.yielding_options useless. Fixes: #9503
2022-04-12qt module: also prefer the changed name scheme for the toolsEli Schwartz1-1/+3
Although Qt6 has decided these are "internal" commands and should never be run directly, so they don't get symlinked to /usr/bin at all, and are only available in the qt_dep.bindir anyway. But, the general naming pattern should be followed on principle.
2022-04-12qt dependency: adapt to the qmake command changed nameEli Schwartz1-1/+1
Qt now has official guidance for the symlinked names of the tools, which is great. Qt now officially calls the tools `fooX` instead of `foo-qtX` where the major version of Qt is X. Which is not great, because a bit of an unofficial standard had prior art and now needs to change, and we never adapted. Prefer the official name whenever looking up qmake, and in the testsuite, specifically look only for the official name on versions of qt which we know should have that.
2022-04-12qt dependency: find the correct -qtX configtool nameEli Schwartz1-1/+2
Fixes regression in commit c211fea51389728783cf59ae41156a5e0de9c41a. The original dependency lookup looked for `qmake-{self.name}`, i.e. `qmake-qt5`, but when porting to config-tool, it got switched to `qmake-{self.qtname}` i.e. `qmake-Qt6`, which was bogus and never worked. As a result, if `qmake-qt5` and `qmake` both existed, and the latter was NOT qt5, it would only try the less preferred name, and then fail. We need to define self.name early enough to define the configtool names, which means we need to set it before running the configtool __init__() even though configtool/pkgconfig would also set it to the same value. Mark the tests as passing on two distros that were failing to detect qmake due to this issue, and were marked for skipping because we assumed that the CI skipping there was an expected case rather than an old regression.
2022-04-12Add support for Qt 6.1+John Lindgren2-0/+11
Qt 6.1 moved the location of some binaries from QT_HOST_BINS to QT_HOST_LIBEXECS as noted in the changelog: c515ee178f Move build tools to libexec instead of the bin dir - Tools that are called by the build system and are unlikely to be called by the user are now installed to the libexec directory. https://code.qt.io/cgit/qt/qtreleasenotes.git/tree/qt/6.1.0/release-note.txt It's possible to help the 'qt' module find the tools by adding Qt's libexec directory to the PATH environment variable, but this manual workaround is not ideal. To compensate, meson now needs to look for moc, rcc, uic, etc. in QT_HOST_LIBEXECS as well as QT_HOST_BINS. Co-authored-by: Stefan Hajnoczi <stefanha@jammr.net>
2022-04-12cmake: Always use all compilers for LLVM (fixes #10249)Daniel Mensinger3-4/+14
2022-04-12python module: windows dll name for pypy needs special casingMatti Picus1-1/+9
2022-04-11mdist: use better approach to finding original configured optionsEli Schwartz1-4/+14
Instead of reading intro-buildoptions.json, a giant json file containing every option ever + its current value, use the private file that is internally used by msetup for e.g. --wipe to restore settings. This accurately tracks exactly the options specified on the command line, and avoids lengthy summary messages containing all the overridden defaults. It also avoids passing potentially incompatible options, such as explictly specifying -Dpython.install_env while also having a non-empty -Dpython.{x}libdir Fixes #10181
2022-04-10Use a temp file to invoke the introspection command.Jussi Pakkanen1-1/+6
This is more reliable as '-c' can, for example, exhaust the maximum command line length.
2022-04-10python module: restore logging for broken pythonEli Schwartz1-5/+12
This check was erroneously removed in commit c5c02b72e132a03ae0284bdd5e15d1675301a37d
2022-04-07Revert "wayland: Also lookup scanner in pkgconfig"Eli Schwartz4-30/+26
This reverts commit 7954a4c9cbf8355d8c8ea9b3d98df45d9f96f66e.
2022-04-04wayland: Also lookup scanner in pkgconfigXavier Claessens4-26/+30
This moves generally useful logic from GNOME module's _get_native_binary() into find_program() implementation. We could decide later to expose it as public API.
2022-04-03cmake: Better error message when configuring a CMake subproject fails.Daniel Mensinger2-4/+23
2022-04-01main: Make the msys/python check work again, in some casesChristoph Reiter1-8/+3
msys/python in MSYS2 pretends to be cygwin in all cases for some time now, so this check was impossible to hit. The underlying confusion it tried to prevent is still there, namely trying to build with mingw but wrongly using a msys/cygwin python/meson. We can use the MSYSTEM env var to detect if we are in a mingw shell, and in case the Python doesn't match we suggest installing mingw variants of both python and meson. Using msys/python + meson in a MSYS environment works fine on the other hand, so no need to error out in that case. Fixes #8726 Also addresses the concern raised in https://github.com/mesonbuild/meson/issues/3653#issuecomment-474122564
2022-03-31i18n: don't let our maintainer targets run via wrapped envEli Schwartz1-2/+2
They are RunTargets because they are one-shot commands without outputs. But we implement them purely via our internal wrapper for gettext, so there is no reason to wrap them *again* in our internal wrapper for meson_exe and set a bunch of environment variables we know we absolutely do not need, use, or want. This avoids the ugly "wrapped due to env" status, and allows users to directly see the command being run without going into despair at obscure pickled nonsense. It also offers a tiny defense against upgrading Meson without reconfiguring. People should not do that, and we error out about this in a bunch of places, but `--internal gettext` has a perfectly stable interface just like most build tools that aren't part of Meson internals, since it uses command line arguments instead of pickling.
2022-03-31allow RunTarget to skip wrapping due to envEli Schwartz3-9/+13
Forcing serialization on when writing out the build rule makes very little sense. It was always "forced" on because we mandated a couple of environment variables due to legacy reasons. Add an attribute to RunTarget to say that a given target doesn't *need* those environment variables, and let ninja optimize them away and run the command directly if set.
2022-03-31Handle same Framework multiple times in Xcode.Jussi Pakkanen1-2/+4
2022-03-31Handle feed and capture in xcodebackend.Jussi Pakkanen1-1/+2