Commit Graph

13056 Commits

Author SHA1 Message Date
Tristan Partin e05a88835a Use f-strings in JavaCompiler 2022-10-24 21:43:25 +03:00
Tristan Partin e87259f4a7 Add missing compiler functions to JavaCompiler
Fixes #2571
2022-10-24 21:43:25 +03:00
Robert Cohn 1939e567d6 basic support for oneapi compilers 2022-10-24 18:55:22 +03:00
Xavier Claessens 942aea230f Add MASM compiler
ml and armasm are Microsoft's Macro Assembler, part of MSVC.
2022-10-24 14:52:13 +02:00
Xavier Claessens e04bce3f04 Not all compilers support depfile 2022-10-24 14:52:13 +02:00
Eli Schwartz c8aecc7685 hotdoc module: add partially typed kwargs
We accept a list of known kwargs of required types, but also arbitrary
kwargs understood by the hotdoc program (sometimes via extensions). Now
that we can partially type-check kwargs, do so here.
2022-10-24 15:16:02 +03:00
Eli Schwartz e27653499a add option to typed_kwargs that allows unknown kwargs through
Some functions cannot be fully type checked, because our API allows
fully arbitrary kwargs and treats them as data to pass through to the
underlying feature. For example, hotdoc command line arguments.

This change allows us to type check some kwargs with known types and
possibly required status, and make their values consistent(ly defaultable),
while preserving the optional nature of the additional kwargs.
2022-10-24 15:16:02 +03:00
Elliott Sales de Andrade 9c4d6088b1 Accept disablers in summary values
They are commonly used as a replacement for a `dependency`, and not
accepting them in `summary` breaks the last example in [1] when used as
a value.

[1] https://mesonbuild.com/Disabler.html#disabling-parts-of-the-build
2022-10-24 11:17:18 +02:00
Xavier Claessens 4f4076bfc0 nasm: Harcode default path on Windows
NASM's installer does not add itself into PATH, even when installed by
choco.
2022-10-24 11:06:57 +02:00
Xavier Claessens eb731cda75 Add missing doc for NASM language 2022-10-24 11:06:57 +02:00
Xavier Claessens d29ef2b128 Add yasm as fallback for nasm language 2022-10-24 11:06:57 +02:00
Xavier Claessens 01ee141339 Add NASM compiler 2022-10-24 11:06:57 +02:00
Eli Schwartz 4e374d5cef
run_mypy: add extra logging and permit specifying files to check
If those files are not yet known to be typed, skip them. This makes it
possible to trivially check a shortlist of files that were just changed
and see if they regress our mypy coverage. Ideal for use in a git
pre-commit hook.
2022-10-24 00:37:51 -04:00
Jussi Pakkanen 4c2b64188d
Merge pull request #10916 from xclaesse/preprocess
Add cc.preprocess() method
2022-10-23 17:24:46 +03:00
Xavier Claessens ebbaeec51b gnulike: Fix preprocessing files with any extension 2022-10-23 12:21:46 +02:00
Xavier Claessens d53486bf9c Add doc and release notes for cc.preprocess() 2022-10-23 12:21:46 +02:00
Xavier Claessens 1d56df9409 Add unit test for cc.preprocess() 2022-10-23 12:21:46 +02:00
Xavier Claessens 42a7f8e8ef vs backend: Add support for CompileTarget
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-23 12:21:46 +02:00
Xavier Claessens 65590e6e4b Add cc.preprocess() method for c-like compilers
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-23 12:21:46 +02:00
Xavier Claessens 5e0f22896f Compilers: Add a preprocessor mode for clike compilers
A compiler object can now return a list of "modes", they are new
compiler object specialized for a specific task.
2022-10-23 12:21:46 +02:00
Xavier Claessens 064165485c Fix excluding sources for static lib in both_libraries()
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-23 13:18:34 +03:00
Elliott Sales de Andrade fa2585d0b3 Fix typos in docs 2022-10-23 03:06:39 +03:00
Zhao, Gang b98356e055 doc: Fix link 2022-10-22 13:18:07 +03:00
Xavier Claessens 7737398cd3 msubprojects: Fix issues when updating all wraps
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-21 17:35:26 +03:00
Thomas Li 2761131ff9 BUG: Don't add debug files as targets when not building in debug mode 2022-10-19 11:32:25 -04:00
Xavier Claessens af6d70a176 ninja: Simplify getting rule name from compiler object 2022-10-18 16:32:03 +02:00
Nirbheek Chauhan 7912901acc hotdoc: Fix typo in argument 2022-10-14 05:14:46 +05:30
Luke Elliott 4f0452b283 fix: don't set FavorSizeOrSpeed in vs backend if optimization disabled (/Od set).
Debugging is broken with clang-cl when FavorSizeOrSpeed is set.
2022-10-13 09:02:54 -04:00
Tatsuyuki Ishi 673dca5c07 Add b_thinlto_cache for automatically configuring incremental ThinLTO 2022-10-13 04:18:13 -04:00
Tatsuyuki Ishi a0032480d6 clang: Support ThinLTO with mold 2022-10-13 04:18:13 -04:00
Tatsuyuki Ishi c693d0576b linkers: Add missing mold entries to __init__ 2022-10-13 04:18:13 -04:00
Jussi Pakkanen 9a57608cac
Merge pull request #10357 from xclaesse/update-wrapdb
Make `meson wrap update` command update all wraps in parallel
2022-10-12 22:52:25 +03:00
Nirbheek Chauhan 9b33885c2d interpreter: Fix msg when none of the dependencies have names
This case is identical to the case when there's no dependencies
specified, so it should behave the same way.
2022-10-12 08:13:02 -04:00
Nirbheek Chauhan c50d837a0c interpreter: Don't say we're using -lfoo args when we're not
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-12 08:13:02 -04:00
Xavier Claessens aaabd6224f Make `meson wrap update` command update all wraps in parallel
This moves the implementation into msubprojects because it has all the
infrastructure to update wraps in parallel while keeping "meson wrap"
UX.
2022-10-11 15:54:59 -04:00
Xavier Claessens cd82804533 Move some code from wraptool.py to wrap.py 2022-10-10 17:09:26 -04:00
Xavier Claessens 312bede496 wrap: Ignore directories that have a .wrap with the same name
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-10 17:01:51 -04:00
Jussi Pakkanen 46acd6cd4a
Merge pull request #8941 from xclaesse/wrapdb
Automatically use WrapDB fallback
2022-10-10 22:17:00 +03:00
Xavier Claessens 8c3a87847e Document and test new WrapDB auto fallback 2022-10-10 12:47:32 -04:00
Xavier Claessens 39d825fabf Get fallback varname from wrap file after it has been configured
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-09 13:04:04 -04:00
Xavier Claessens ced9efb579 Get wrap from wrapdb when not found locally
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-09 13:04:03 -04:00
Xavier Claessens 6776bfad3c Add "meson wrap update-db" command
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-09 12:58:59 -04:00
Tristan Partin 58581ae3de Fix some wording in a JNISystemDependency comment 2022-10-09 16:47:47 +03:00
Tristan Partin 80b101443d Add BSD support to the JNISystemDependency
Supports all BSDs that Meson currently supports.

Fixes #10883
2022-10-09 16:47:47 +03:00
Eli Schwartz 2cb7350d16 run wrapped-due-to-env commands on unix via the env program
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-09 08:03:58 -04:00
Jan Tojnar a590cfde0c compilers: Add optimization=plain option
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-09 14:43:18 +03:00
Christoph Reiter e945f35cd7 CI: add potential workaround for python crashes in MSYS2
There hasn't been any progress on this upstream lately, so
try what we use in MSYS2 CI right now
2022-10-07 18:35:03 -04:00
Hagen Möbius 9add5d03b6 Add handling Qt6's EntryPoint library.
- 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-06 04:29:25 -04:00
Jussi Pakkanen b0eecda108 Only use Debian path fixing on old distros. 2022-10-06 01:07:17 +03:00
Dylan Baker df1b95cf2b
pylint: enable consider-merging-isinstance 2022-10-04 00:33:14 -04:00