aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cs.py
AgeCommit message (Collapse)AuthorFilesLines
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz1-2/+2
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-04-11Change "can not" to "cannot" throughout projectHiPhish1-1/+1
The word "cannot" expresses inability to do something whereas "can not" expresses the ability to refrain from doing something.
2022-10-25Compilers: Keep ccache and exelist separatedXavier Claessens1-1/+1
Only combine them in the Compiler base class, this will make easier to run compiler without ccache.
2022-10-09compilers: Add optimization=plain optionJan Tojnar1-1/+3
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-07-03fix totally invalid import of an importEli Schwartz1-1/+3
MachineChoice is a mesonlib object, not a compilers object, so it makes no sense to import it from the latter simply because the latter imports it too. This results in brittle module dependencies and everything breaking when a refactor removes it from the latter. ... also it is a typing-only import so while we are fixing it to import from the right place, we can also put it in a type-checking block.
2022-01-10compilers: push the compiler id to a class variableDylan Baker1-7/+7
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
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-1/+1
2021-03-14compilers/linkers: Add a methhod for getting the rspfile syntaxDylan Baker1-0/+7
2020-10-01compilers/cs: Add type annotationsDylan Baker1-42/+31
2020-10-01compilers: move get_dependency_gen_args to base CompilerDylan Baker1-3/+0
So that every subclass doesn't have to reimplement it. Especially since the Gnu implementation moved out of the CCompiler and into the GnuLikeCompiler mixin
2020-10-01compilers: move split_shlib_to_parts to the base compilerDylan Baker1-3/+0
Only the GnuLikeCompiler overrides this, and it's implemented multiple places
2020-09-24compilers: make is_cross part of the base Compiler classDylan Baker1-1/+0
Every class needs to set this, so it should be part of the base. For classes that require is_cross, the positional argument remains in their signature. For those that don't, they just allow the base class to set their value to it's default of False.
2020-09-24compilers: put name_string method in base compilerDylan Baker1-3/+0
Every language had the exact same implementation
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-2/+2
2019-12-12compilers: Make get_display_language a class or static methodDylan Baker1-1/+2
Currently this is done at the instance level, but we need it at the class level to allow compiler "lang" args to be gotten early enough. This patch also removes a couple of instance of branch/leaf classes providing their own implementation that is identical to the Compiler version.
2019-12-12compilers: move language attribute to the class levelDylan Baker1-1/+3
We know that if a compiler class inherits CCompiler it's language will be C, so doing this at the class level makes more sense.
2019-10-07compilers: replace uses of mesonlib.is_<os>() with self.info.is_<os>()Dylan Baker1-2/+1
Since these are cross compilation safe, while the former is not.
2019-10-07compilers: replace CompilerType with MachineInfoDylan Baker1-7/+15
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-08-14compilers: Dispatch to dynamic linker classDylan Baker1-13/+3
Most of the cuda code is from Olexa Bilaniuk. Most of the PGI code is from Michael Hirsc
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson1-7/+7
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-04-29Fix builtin variable namesDaniel Mensinger1-2/+2
2019-02-01C# and Java compilers should have `is_cross = False`John Ericson1-0/+1
All compilers should define this attribute. Probably should change base class to require this.
2019-01-06Added more compiler option supportDaniel Mensinger1-0/+6
2019-01-06Absolute path generation refactoringDaniel Mensinger1-0/+3
2019-01-06Added unit testDaniel Mensinger1-1/+1
2019-01-06Fixed list_target_files and list_targetsDaniel Mensinger1-1/+1
2018-08-18Convert buildtype to optimization and debug options (#3489)Jussi Pakkanen1-0/+13
2018-06-18macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan1-1/+1
On macOS, we set the install_name for built libraries to @rpath/libfoo.dylib, and when linking to the library, we set the RPATH to its path in the build directory. This allows all built binaries to be run as-is from the build directory (uninstalled). However, on install, we have to strip all the RPATHs because they point to the build directory, and we change the install_name of all built libraries to the absolute path to the library. This causes the install name in binaries to be out of date. We now change that install name to point to the absolute path to each built library after installation. Fixes https://github.com/mesonbuild/meson/issues/3038 Fixes https://github.com/mesonbuild/meson/issues/3077 With this, the default workflow on macOS matches what everyone seems to do, including Autotools and CMake. The next step is providing a way for build files to override the install_name that is used after installation for use with, f.ex., private libraries when combined with the install_rpath: kwarg on targets.
2018-05-09Revert "Add macOS linker versioning information"Nirbheek Chauhan1-1/+1
This reverts commit fa6ca160548d7e8df9c4c724e6c96f5e004e5316. Closes https://github.com/mesonbuild/meson/issues/3550
2018-04-16Add macOS linker versioning informationTom Schoonjans1-1/+1
This patch exploits the information residing in ltversion to set the -compatibility_version and -current_version flags that are passed to the linker on macOS.
2018-02-25Hide banner when invoking csc.Jussi Pakkanen1-1/+7
2018-02-25Add support for Visual Studio csc c# compilerThibault Saunier1-6/+32
2017-12-16More version information for C#Christoph Behle1-2/+2
2017-07-21Add build_rpath as new property allowing people to specify rpath entries ā†µJussi Pakkanen1-1/+1
that are used in the build tree but will be removed on install.
2017-06-26Use 'C sharp' instead of 'C#'Guillaume Poirier-Morency1-1/+1
The '#' is reserved for Ninja comments and cannot be escaped.
2017-06-26Add 'Compiler.get_display_language'Guillaume Poirier-Morency1-0/+3
Use this when we print language-related information to the console and via the Ninja backend.
2017-06-23Split out languages from compilers.pyAlistair Thomas1-0/+106