Commit Graph

21 Commits

Author SHA1 Message Date
Eli Schwartz 680b5ff819
treewide: add future annotations import 2023-02-01 17:01:30 -05: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
Dylan Baker 1209b8820b compilers: push the compiler id to a class variable
It really is a per class value, and shouldn't be set per instance. It
also allows us to get rid of useless constructors, including those
breaking mypy
2022-01-10 15:53:26 -05:00
Eli Schwartz 87e13af1c8
apply flake8 fixes for unused imports and missing imports 2021-09-14 15:55:07 -04:00
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.
2021-06-25 19:34:48 +02:00
Dylan Baker 71db6b04a3 use OptionKey for builtin and base options
I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.

this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
2021-01-04 12:20:40 -08:00
Dylan Baker f9316fbb46 compilers/icl: Fix pch usage 2020-10-01 15:06:10 -07:00
Dylan Baker 1c20f187e8 compilers/intel: use get_compiler_check_args
Instead of trying to override the compiles() method, which gets skipped
in a bunch of cases.
2020-10-01 15:05:01 -07:00
Ian Harvey 3afe18228a compilers: Use /Od for no-optimisation flag for Intel compilers on windows
Intel compilers on Windows (and the Microsoft C++ compiler) use /Od to disable optimisation, not /O0.
2020-09-30 12:01:50 -07:00
Dylan Baker 682d22129c compilers: Tell mypy that the compiler mixins are just that
We do this by making the mixins inherit the Compiler class only when
mypy is examining the code (using some clever inheritance shenanigans).
This caught a bunch of issues, and also lets us delete a ton of code.
2020-09-24 12:14:13 -07:00
Dylan Baker 8ee1e6b768 compilers/mixins/intel: make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker a0a8ef567e compilers/mixins/intel: Use the has_func_attribute_extra_args function
Instead of putting that extra argument in the base compiles() class
2020-09-24 12:14:13 -07:00
Daniel Mensinger 3dbfe8f75a
typing: fully annotate arglist 2020-09-08 20:15:57 +02:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Michael Hirsch, Ph.D 0b7fe3f78a intel/intel-cl: handle arguments in intel-specific way
intel compiler's defaults are different enough from MSVC and GNU
that it's necessary to set specific defaults for Intel compilers.

This corrects/improves behaviors initially addressed in  b1c8f765fa
2019-12-14 23:35:07 +02:00
Michael Hirsch, Ph.D b1c8f765fa intel/intel-cl: use appropriate buildtype options
This puts appropriate default options across buildtype for Intel and
Intel-Cl compilers, for C, C++ and Fortran. Prior to this PR, the
behavior of Intel compilers vs. GNUlike was not the same, in
particular, debug traceback available by default for GNUlike compilers
was not present with Intel compilers.
2019-12-04 21:48:34 +02:00
Dylan Baker 0c22798b1a compilers: replace CompilerType with MachineInfo
Now that the linkers are split out of the compilers this enum is
only used to know what platform we're compiling for. Which is
what the MachineInfo class is for
2019-10-07 12:08:20 -07:00
Dylan Baker 06dcbd50ee compilers: Dispatch to dynamic linker class
Most of the cuda code is from Olexa Bilaniuk.
Most of the PGI code is from Michael Hirsc
2019-08-14 13:13:23 -07:00
Michael Hirsch, Ph.D a7c8a69afb
intel-cl: readd missing import 2019-07-30 00:27:13 -04:00
Dylan Baker 521e057d97 compilers/mixins/intel: add type annotations 2019-07-15 10:59:22 -07:00
Dylan Baker b8368c1617 compilers: Put Intel compiler classes into the mixins folder 2019-07-15 10:59:22 -07:00