Xavier Claessens
ea02c1c48a
msvc: Assume UTF8 source by default
...
Currently every project that uses UTF8 for its source files must add
'/utf-8' argument otherwise they don't work non-English locale MSVC.
Since meson.build itself is assumed to be UTF8 by default, seems better
to assume it for source files by default too.
For example:
- https://gitlab.freedesktop.org/gstreamer/gst-build/-/blob/master/meson.build#L62
- https://gitlab.gnome.org/GNOME/glib/-/blob/main/meson.build#L29
3 years ago
Dylan Baker
4d7031437c
pylint: turn on superflous-parens
...
We have a lot of these. Some of them are harmless, if unidiomatic, such
as `if (condition)`, others are potentially dangerous `assert(...)`, as
`assert(condtion)` works as expected, but `assert(condition, message)`
will result in an assertion that never triggers, as what you're actually
asserting is `bool(tuple[2])`, which will always be true.
3 years ago
Tristan Partin
be92e37837
Add Java module
...
The Java module will serve as a source for easing Java development
within Meson. Currently it only supports generating native header files.
3 years ago
Dylan Baker
a3c94956c8
compilers: Add get_no_warn_args to the base Compiler class
...
Because it should be defined there.
3 years ago
Dylan Baker
6d055b1e27
compilers/compilers: Fix some potential issues spotted by pyright
...
There are two changes here, one is to remove an `elif` that is
effectively an `else`, that helps the type checker and provides a small
speedup potentially. The second is a potentially unbound variable, that
currently isn't hit, but very much could be.
3 years ago
Dylan Baker
e3c72ad7c7
compilers: Fix extra_args parameter
...
which can also be a callable taking a CompileChekcMode as an argumetn
and returning a list of strings.
3 years ago
Dylan Baker
e9639be167
compilers: Fix annotations for run and cached_compile
...
Which absolutely should accept `str | File`, but the annotations claim
that only strings are accepted.
3 years ago
Jussi Pakkanen
a90d2925dd
Revert "compilers/c++: Add MSVC option to make the __cplusplus define accurate"
...
This reverts commit 0b97d58548
.
3 years ago
Dylan Baker
0b97d58548
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
3 years ago
Jussi Pakkanen
f2fe271198
Add support for finding Javascript source libraries with Emscripten.
3 years ago
miebka
f8c4752cbc
C2000 compiler also accepts *.cla files
3 years ago
David Seifert
28d13f4bfe
Cuda: Enable PGO
3 years ago
David Seifert
d648f3497e
Cuda: Filter -isystem with system paths
3 years ago
David Seifert
631abce82f
Cuda: Pass -DNDEBUG through
3 years ago
Paolo Bonzini
3efed376c3
linkers: remove is_shared_module argument to get_soname_args
...
The argument is now unused, drop it.
3 years ago
Pamplemousse
762c073500
Clang: Apply `-O0`
...
Fix #8986
3 years ago
Andrea Pappacoda
81d9acab87
Fix unsupported linker error message
...
An `f` was dropped in bd6f46e723
3 years ago
Eli Schwartz
bd6f46e723
condense lines
3 years ago
Eli Schwartz
b4b488f33c
simplify mesonlib imports for the sake of line lengths
3 years ago
Eli Schwartz
dd31891c1f
more f-strings too complex to be caught by pyupgrade
3 years ago
miebka
3021f256ea
C2000: linker uses now binary setting defined within the cross-file
3 years ago
Daniel Mensinger
3e396b3782
fix: Always explicitly set encoding for text files ( fixes #8263 )
3 years ago
Ian Harvey
84b371c645
Update detect.py
...
Adjust Intel Fortran compiler detection to handle changes in ifort logo with the introduction of the oneapi toolkit. See #8338 .
3 years ago
Daniel Mensinger
b95d6e319f
typing: Annotate compilers.detect
3 years ago
Daniel Mensinger
3f889606c7
Split compiler detection from Environment
...
This moves all the compiler detection logic into the new
compilers.detect module. This dramatically reduces the size
and complexity of Environment.
3 years ago
Justin Handville
e8e03cdc72
Fixed style issue as per comments on PR 8911.
3 years ago
Justin Handville
9f248c778d
Fix for Issue 8910 (Meson filters CMake asm files)
3 years ago
Daniel Mensinger
66b32a4591
holders: Introduce HoldableObject
4 years ago
Daniel Mensinger
202e345dfb
interpreter: Refactor interpreter.compiler to use ObjectHolder
4 years ago
Daniel Mensinger
9c40b33cf6
compilers: Fix missing functions in Compiler base class
4 years ago
Eli Schwartz
998076a192
upgrade percent formatted strings pyupgrade did not catch
4 years ago
Eli Schwartz
3eb1da1fa2
condense lines
4 years ago
Eli Schwartz
2c71b63e77
more f-strings everywhere
...
pyupgrade didn't catch many .format() methods which were too complex
(e.g. multiline or applied to templates rather than string literals)
4 years ago
Dylan Baker
0bc18f26a2
cython: Add an option for selecting python 3 vs python 2 output
4 years ago
Dylan Baker
4d1cbd1b8a
compilers: Add cython file suffixes
4 years ago
Dylan Baker
edf1a21722
compilers: Expose Cython compiler
4 years ago
Dylan Baker
e9681b463d
hack: compilers/cython: hardcode python 3 not 2
4 years ago
Dylan Baker
79e50caa7f
compilers: Add a cython Compiler
4 years ago
Daniel Mensinger
240434b167
typing: Fully annotate dependencies.cuda
4 years ago
Dylan Baker
113a159514
use an immutable list for an lru_cached functions
...
When mutable items are stored in an lru cache, changing the returned
items changes the cached items as well. Therefore we want to ensure that
we're not mutating them. Using the ImmutableListProtocol allows mypy to
find mutations and reject them. This doesn't solve the problem of
mutable values inside the values, so you could have to do things like:
```python
ImmutableListProtocol[ImmutableListProtocol[str]]
```
or equally hacky. It can also be used for input types and acts a bit
like C's const:
```python
def foo(arg: ImmutableListProtocol[str]) -> T.List[str]:
arg[1] = 'foo' # works while running, but mypy errors
```
4 years ago
Dylan Baker
156d6160d1
compilers: Add `get_debug_args` to base Compiler
...
This was missed, there should be an implementation in the base Compiler
class, if for nothing else to help mypy
4 years ago
Dylan Baker
b1b8e777a2
rust: override get_linker_always_args
...
instead of opencoding what should be there in the rust compile rule
4 years ago
Volker-Weissmann
4ca9a16288
.C files are now treated as C++ code
4 years ago
Peter Harris
be015a37d7
Visual Studio Address Sanitizer updates
...
* Allow address sanitizer for Visual Studio 2019 version 16.9
Address Sanitizer was first supported with the current syntax in Visual
Studio 16.9.0 (cl version 19.28.29910).
* VS: Convert /fsanitize=address to project file setting
4 years ago
Jussi Pakkanen
ab0b727427
Add gnuXX stds to Objective C.
4 years ago
Jussi Pakkanen
c54dd63547
Make objective C use C standard version. Closes #5495 .
4 years ago
Alexander Neumann
8f12102549
deactivate intrinsic functions if no optimizations are requested
4 years ago
Ralf Gommers
a48a89374a
Clean up unused imports
4 years ago
Ralf Gommers
d0325c898a
Use sanity_check_impl for objc/objpp
...
This gets rid of compile warnings, and simplifies the code.
Note that `work_dir` in sanity_check_impl was incorrect,
it was used both to prepend to file names and as cwd=work_dir
argument to Popen. This is fixed here.
Closes gh-7344
4 years ago
Dylan Baker
f99ed692c4
environment: get environment variables for both host and build machines
...
Fixes #8605
4 years ago