aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2022-10-23Merge pull request #10916 from xclaesse/preprocessJussi Pakkanen9-21/+184
Add cc.preprocess() method
2022-10-23gnulike: Fix preprocessing files with any extensionXavier Claessens1-0/+6
2022-10-23vs backend: Add support for CompileTargetXavier Claessens2-0/+46
Since vs backend only support the C compiler, everything else are custom targets. Convert CompileTarget into a Generator to reuse existing code. This will be useful in the future to support transpilers, and assemblers.
2022-10-23Add cc.preprocess() method for c-like compilersXavier Claessens4-3/+83
This introduce a new type of BuildTarget: CompileTarget. From ninja backend POV it is the same thing as any other build target, except that it skips the final link step. It could be used in the future for transpilers too.
2022-10-23Compilers: Add a preprocessor mode for clike compilersXavier Claessens4-1/+38
A compiler object can now return a list of "modes", they are new compiler object specialized for a specific task.
2022-10-23Fix excluding sources for static lib in both_libraries()Xavier Claessens1-10/+12
When using both_libraries(), or library() with default_library=both, we remove all sources from args and kwargs when building the static library, and replace them by the objects from the shared library. But sources could also come from any InternalDependency, in which case we currently build them twice (not efficient) and link both objects into the static library. It also means that when we needlessly build those source for the static library, it miss order dependency on generated headers that we removed from args/kwargs, which can cause build errors in the case the source from static lib is compiled before the header in shared lib gets generated. This happened in GLib: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2917.
2022-10-21msubprojects: Fix issues when updating all wrapsXavier Claessens1-22/+10
When updating all wraps, it is not an error if some have not been downloaded or some does not have a wrap file.
2022-10-19BUG: Don't add debug files as targets when not building in debug modeThomas Li1-2/+4
2022-10-18ninja: Simplify getting rule name from compiler objectXavier Claessens1-17/+11
2022-10-14hotdoc: Fix typo in argumentNirbheek Chauhan1-1/+1
2022-10-13fix: don't set FavorSizeOrSpeed in vs backend if optimization disabled (/Od ↔Luke Elliott1-1/+2
set). Debugging is broken with clang-cl when FavorSizeOrSpeed is set.
2022-10-13Add b_thinlto_cache for automatically configuring incremental ThinLTOTatsuyuki Ishi5-8/+42
2022-10-13clang: Support ThinLTO with moldTatsuyuki Ishi1-4/+9
2022-10-13linkers: Add missing mold entries to __init__Tatsuyuki Ishi1-0/+2
2022-10-12Merge pull request #10357 from xclaesse/update-wrapdbJussi Pakkanen3-54/+98
Make `meson wrap update` command update all wraps in parallel
2022-10-12interpreter: Fix msg when none of the dependencies have namesNirbheek Chauhan1-5/+3
This case is identical to the case when there's no dependencies specified, so it should behave the same way.
2022-10-12interpreter: Don't say we're using -lfoo args when we're notNirbheek Chauhan1-9/+11
cc.compiles(), and other compiler checks that use cc.compiles() under the hood, do not use link args at all when doing the compile check, so messages like this: ``` Checking if "have zlib" with dependency -lz compiles: YES ``` is very misleading. The compiler check command-line for that is: ``` cc [...]/testfile.c -o [...]/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 ``` Note the lack of linker args.
2022-10-11Make `meson wrap update` command update all wraps in parallelXavier Claessens2-17/+63
This moves the implementation into msubprojects because it has all the infrastructure to update wraps in parallel while keeping "meson wrap" UX.
2022-10-10Move some code from wraptool.py to wrap.pyXavier Claessens2-34/+32
2022-10-10wrap: Ignore directories that have a .wrap with the same nameXavier Claessens1-3/+3
If we update e.g. glib.wrap from wrap-git with directory=glib to wrap-file with directory=glib-2.70 we could still have the glib directory that is not referenced by any .wrap file any more. We should still ignore that directory otherwise it overrides the glib.wrap we parsed.
2022-10-10Merge pull request #8941 from xclaesse/wrapdbJussi Pakkanen3-23/+81
Automatically use WrapDB fallback
2022-10-09Get fallback varname from wrap file after it has been configuredXavier Claessens1-8/+8
When _subproject_impl() is called the wrap file could not have been downloaded form wrapdb yet, it is done when fetching the subproject. Delay getting the variable name to when we actually need it, at that point we are sure the wrap file has been downloaded.
2022-10-09Get wrap from wrapdb when not found locallyXavier Claessens1-13/+55
Download wrap file from wrapdb automatically when it is not found locally but we have it in wrapdb.json. This makes for example `dependency('glib-2.0')` work out of the box simply by running `meson wrap update-db`, even if the project does not provide any wraps.
2022-10-09Add "meson wrap update-db" commandXavier Claessens1-2/+18
It downloads releases.json from wrapdb and store it in subprojects/wrapdb.json. That file will be used by Meson to find dependency fallbacks offline.
2022-10-09Fix some wording in a JNISystemDependency commentTristan Partin1-1/+1
2022-10-09Add BSD support to the JNISystemDependencyTristan Partin1-0/+8
Supports all BSDs that Meson currently supports. Fixes #10883
2022-10-09run wrapped-due-to-env commands on unix via the env programEli Schwartz1-1/+18
First, check if the env program exists. If it does, it is faster than doing it via a python script `basically-env.py` that maybe imports all of mesonbuild.* as a side effect of project structure. We do not, however, use env for setting up PATH additions, since env can override an environment variable but not extend it. So in that case we still need to wrap the command via python. By default, all run_targets (at least) are wrapped and now wrap via the `env` program as they export e.g. MESONINTROSPECT='/usr/bin/meson introspect'
2022-10-09compilers: Add optimization=plain optionJan Tojnar15-12/+33
https://github.com/mesonbuild/meson/pull/9287 changed the `optimization=0` to pass `-O0` to the compiler. This change is reasonable by itself but unfortunately, it breaks `buildtype=plain`, which promises that “no extra build flags are used”. `buildtype=plain` is important for distros like NixOS, which manage compiler flags for optimization and hardening themselves. Let’s introduce a new optimization level that does nothing and set it as the default for `buildtype=plain`.
2022-10-06Add handling Qt6's EntryPoint library.Hagen Möbius1-9/+18
- this fixes #10792 - Qt6EntryPoint(d) replaces qtmain(d) from Qt 4 & 5 - uses the same mechanism: `main: true` - uses a special mixin class for pkg-config and config-tool dependency calculation
2022-10-04pylint: enable consider-merging-isinstanceDylan Baker3-3/+3
2022-10-04pylint: enable use-a-generatorDylan Baker8-21/+21
This catches some optimization problems, mostly in the use of `all()` and `any()`. Basically writing `any([x == 5 for x in f])` vs `any(x == 5 for x in f)` reduces the performance because the entire concrete list must first be created, then iterated over, while in the second f is iterated and checked element by element.
2022-10-03pylint: enable unnecessary-lambdaDylan Baker1-1/+1
2022-10-03pylint: enable unnecessary-comprehensionDylan Baker5-10/+6
2022-10-03pylint: enable consider-using-(min|max)-builtinDylan Baker1-6/+2
There's only one case of each, in the same function, so I've handled both in the same commit.
2022-10-03pylint: enable unspecified-encodingDylan Baker1-1/+1
2022-10-03pylint: enable unnecessary-dunder-callDylan Baker1-2/+2
2022-10-03AIX: allow link_whole, it's the only supported behaviour anywayAndres Freund1-0/+6
As ld's manpage says: "The ld command processes all input files in the same manner, whether they are archives or not"
2022-09-29Add cross-compile support for Microsoft GDK platformsCaleb Cornett1-2/+9
2022-09-28Move classes used by scripts to their own moduleXavier Claessens15-142/+209
Those classes are used by wrapper scripts and we should not have to import the rest of mesonlib, build.py, and all their dependencies for that. This renames mesonlib/ directory to utils/ and add a mesonlib.py module that imports everything from utils/ to not have to change `import mesonlib` everywhere. It allows to import utils.core without importing the rest of mesonlib.
2022-09-28gnome: add support for update-mime-databasePaolo Borelli1-0/+10
Fixes https://github.com/mesonbuild/meson/issues/10865
2022-09-28find_library with argument beginning in "lib" is a bad idea, warn about itEli Schwartz1-0/+2
We need to support cases where the library might be called "foo.so" and therefore we check for exact matches too. But this also allows `cc.find_library('libfoo')` to find libfoo.so, which is strange and won't work in many cases. Emit a warning when this happens. Fixes #10838
2022-09-28mlog: Use less from git on WindowsXavier Claessens1-6/+21
2022-09-28wrap: If the directory exists in a sub-subproject, uses it inplaceXavier Claessens1-4/+7
A subproject could have a sub-subproject as a git submodule, or part of the subproject's release tarball, and still have a wrap file for it (e.g. needed for [provide] section). In that case we need to use the source tree for the sub-subproject inplace instead of downloading a new copy into the main project. This is the case with GLib 2.74, it has a subproject "gvdb" as git submodule, and part of release tarball, it ships gvdb.wrap file as well.
2022-09-28wrap: Small simplificationXavier Claessens1-11/+8
2022-09-28wrap: Set self.directory only onceXavier Claessens1-2/+1
It can wait until after parsing the wrap file to set it.
2022-09-28Automatically tag systemtap filesXavier Claessens1-0/+2
2022-09-28Automaticall tag installed testsXavier Claessens1-0/+2
It is common, at least in GNOME projects, to install tests. Files goes into various locations, including: - /usr/lib/x86_64-linux-gnu/installed-tests - /usr/share/installed-tests - /usr/libexec/installed-tests It is safe to assume that everything that goes into a "installed-tests" subdir should be tagged as "tests" by default.
2022-09-27gnome/yelp: fix `xml:lang` attributesJan Tojnar1-1/+1
itstool detects a language code from the mo file’s basename, so when https://github.com/mesonbuild/meson/commit/26c1869a142a952ffa23fe566a255b259304a39b changed the file name to be prefixed with project name, values like “my-project-xx” ended up in the `xml:lang` attribute of the generated page files, instead of the expected IETF BCP 47 language tag. Let’s fix it by passing a locale code to itstool explicitly.
2022-09-27mconf: Do not print None for empty choicesXavier Claessens1-12/+7
2022-09-27mconf: Use pager only when printing configurationXavier Claessens1-6/+7
Fixes: #10845