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
4 years ago
Daniel Mensinger
3e396b3782
fix: Always explicitly set encoding for text files ( fixes #8263 )
4 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 .
4 years ago
Daniel Mensinger
b95d6e319f
typing: Annotate compilers.detect
4 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.
4 years ago
Justin Handville
e8e03cdc72
Fixed style issue as per comments on PR 8911.
4 years ago
Justin Handville
9f248c778d
Fix for Issue 8910 (Meson filters CMake asm files)
4 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
Dylan Baker
2cd0723c42
Split environment variable and command line cflags
...
They are supposed to have different behavior. The environment variables
apply to both the compiler and linker when the compiler acts as a
linker, but the command line ones do not.
Fixes #8345
4 years ago
Olexa Bilaniuk
2579420a72
Strip host-compiler -std flag from NVCC line.
...
Closes #8523 .
4 years ago
Olexa Bilaniuk
5941e94ff8
Retract "DQSQ" merging in NVCC arguments handling.
...
No coverage, no tests, unreadable, unused, likely premature
optimization.
4 years ago
Olexa Bilaniuk
3dbd493de2
Canonicalize and merge consecutive -Xcompiler flags together.
...
Makes command-line more readable.
4 years ago