summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * Let .pc files specify rpath.Dan Kegel2020-05-161-1/+1
| | | | | | | | Fixes #4027
* | macos: Remove framwork linkerlike argsEric Lemanissier2020-05-131-1/+1
|/ | | | fixes-up 33fbc548ab74e79280d2f57b2cd499d14c1f1e91
* Compiler options per langJohn Ericson2020-04-201-6/+7
| | | | | | | | | | | A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
* compilers: Move things out of clikeDylan Baker2020-04-101-0/+3
| | | | | One method belongs in the base Compiler class, the other belongs in the GnuLikeCompiler class.
* compilers: disable ccache when using temporary source filesLoïc Yhuel2020-03-291-0/+5
| | | | | When doing a compile test with a testfile.c, ccache fails since the path is random. So it's better to disable it, to avoid reporting this as a cache miss.
* Only split linker args with D compilers. Closes: #6845Jussi Pakkanen2020-03-281-4/+8
|
* Fix legacy env var support with crossJohn Ericson2020-03-231-32/+30
| | | | Fix #3969
* compilers: Link D runtime/libphobs dynamically on !WindowsDylan Baker2020-03-191-1/+1
| | | | Fixes: #6786
* Merge pull request #6356 from dcbaker/fix-d-compiler-abstractionsJussi Pakkanen2020-03-121-0/+19
|\ | | | | Fix d compiler abstractions
| * compilers: Don't put split soname args in start groupsDylan Baker2020-03-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Some compilers that act as linker drivers (dmd and ldc) need to split arguments that GCC combines with , (ie, -Wl,-foo,bar -> -L=-foo -L=bar). As such we need to detect that the previous argument contained -soname, and not wrap that in a --start-group/--end-group This modifies the shared library test to demonstrate the problem, with a test case. Fixes #6359
| * compilers: Don't deduplicate -L= argumentsDylan Baker2020-03-061-0/+9
| | | | | | | | This breaks LDC and DMD, so just don't do it.
* | Merge pull request #6532 from jon-turney/languages-native-kwargJussi Pakkanen2020-03-091-0/+9
|\ \ | | | | | | Add add_languages(native:)
| * | Improve error reported when language has no compilerJon Turney2020-02-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | This gives consistent reporting of this error for all platforms. Also, reporting this error when constructing the BuildTarget, rather than discovering the problem during backend generation means that the error is reported against with a location.
* | | mesonlib: Replace unholder argument to listifyDylan Baker2020-03-051-0/+2
| |/ |/| | | | | | | | | listify shouldn't be unholdering, it's a function to turn scalar values into lists, or flatten lists. Having a separate function is clearer, easier to understand, and can be run recursively if necessary.
* | meson: cache the results of can_compileMarcel Hollerbach2020-03-011-0/+1
| | | | | | | | | | | | | | the check for which files can be compiled are called again and again on the same files over and over again. Caching this here shaves off 11s of the build time of efl (which has grown in the last 3 versions to over 40 sec. again)
* | CompilerArgs: make lookup fasterMarcel Hollerbach2020-03-011-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in order to deduplicate arguments as much as possible, we need to check if a argument is already part of the list. Which is quite slow because we are checking 3 lists for that. In smaller projects this might be not of interested. However, in efl things are quite "heavy", alone generating the ninja file took 40 sec.. 16 sec. are spent in __iadd__ of CompilerArgs. What this patch does to speed this all up is: 1. We only check if a element is in post when we know that it must be in post same for pre. 2. the checks for if we already do contain a specific value are now done via a dict, and not via the list. This overall brings the time from 16 sec. spent in __iadd__ to 9 sec. in __iadd__. Another possible solution for all this is to have a internal structure of CompileArgs of trees, so you have the "basic" layer of arguments where the position does not matter. Additionally, you have two stacks of lists, the pre stack and the post stack, duplicates can then be checked when itereting, which would safe another ~4s in terms of efl. However, i do not have time for this undertaking right now.
* | Merge pull request #6637 from ↵Jussi Pakkanen2020-02-231-0/+3
|\ \ | | | | | | | | | | | | mesonbuild/nirbheek/implement-symbolextractor-windows Implement symbolextractor on windows + some cleanups/fixes
| * | ninjabackend: List PDBs in output list for targetsNirbheek Chauhan2020-02-221-0/+3
| |/ | | | | | | | | | | | | | | | | | | This is more correct, and forces the target(s) to be rebuilt if the PDB files are missing. Increases the minimum required Ninja to 1.7, which is available in Ubuntu 16.04 under backports. We can't do the same for import libraries, because it is impossible for us to know at configure time whether or not an import library will be generated for a given DLL.
* | Merge pull request #6668 from ↵Jussi Pakkanen2020-02-211-1/+19
|\ \ | | | | | | | | | | | | mesonbuild/nirbheek/strip-more-unused-linkerlike-args macOS: Remove more unused linkerlike args
| * | macOS: Remove more unused linkerlike argsnirbheek/strip-more-unused-linkerlike-argsNirbheek Chauhan2020-02-211-1/+19
| |/ | | | | | | | | | | | | `-L` and `-headerpad_max_install_names` are both linker arguments that are commonly passed in CFLAGS too. Closes https://github.com/mesonbuild/meson/issues/6294
* | compilers/compilers: Fix get_linker_idDylan Baker2020-02-211-1/+7
|/ | | | | Which could raise an AttributeError when used on languages like Java and C# that don't have separate compilers and linkers.
* compilers: Derive CompilerArgs from collections instead of typingNirbheek Chauhan2020-01-241-1/+1
| | | | | Deriving from typing.MutableSequence does not give us a usable sequence type on Python 3.5.2.
* typing: Fix compatibility with Python 3.5.2Nirbheek Chauhan2020-01-241-1/+1
| | | | | | | Explicitly use the type instead of the string 'NotImplemented' which still works with Python 3.5.2 Fixes https://github.com/mesonbuild/meson/issues/6427
* types: Fix/ignore flake8 B014/F811Daniel Mensinger2020-01-081-11/+11
|
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-69/+69
|
* add compiler.get_linker_id() methodMichael Hirsch, Ph.D2019-12-191-0/+3
| | | | | | | | | | | | | | | this can be useful for if/elif where linker behaviors must be considered. For example, clang with "link" vs gcc with "ld.bfd" etc. ci for compiler.get_linker_id() method doc add @FeatureNew check Co-Authored-By: Daniel Mensinger <daniel@mensinger-ka.de>
* Consider compiler arguments in linker detection logicDylan Baker2019-12-121-2/+4
| | | | | | | | | | | | | If a user passes -fuse-ld=gold to gcc or clang, they expect that they'll get ld.gold, not whatever the default is. Meson currently doesn't do that, because it doesn't pass these arguments to the linker detection logic. This patch fixes that. Another case that this is needed is with clang's --target option This is a bad solution, honestly, and it would be better to use $LD or a cross/native file but this is needed for backwards compatability. Fixes #6057
* Allow setting <lang>_args before the compiler is detectedDylan Baker2019-12-121-97/+82
| | | | | This is required to be able to pass compiler and linker arguments to the methods that try to guess what linker to use.
* compilers: Make get_display_language a class or static methodDylan Baker2019-12-121-2/+3
| | | | | | | | 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.
* Merge pull request #6207 from dcbaker/linker-optionJussi Pakkanen2019-12-111-0/+6
|\ | | | | Add a way to select the dynamic linker meson uses
| * Allow selecting the dynamic linkerDylan Baker2019-12-021-0/+6
| | | | | | | | | | | | | | This uses the normal meson mechanisms, an LD environment variable or via cross/native files. Fixes: #6057
* | compilers: Rework the CompilerArgs to be less awfulDylan Baker2019-12-051-71/+73
| | | | | | | | | | | | | | | | There are two awful things about CompilerArgs, one is that it directly inherits from list, and there are a lot of subtle gotcahs with inheriting from builtin types. The second is that the class allows arguments to be passed in whatever order. That's bad. This also fully annotates the CompilerArgs class, so mypy can type check it for us.
* | compilers: use import typing instead of from typing importDylan Baker2019-12-051-44/+47
| | | | | | | | | | | | | | | | `from foo import` should be used sparingly because of namespace pollution, especially since those names will be exported unconditionally. For typing this is extra annoying because anytime someone wants to use another symbol from the typing module they have to add it to the import line. Use `import typing` to avoid all of this.
* | lgtm: fix __eq__ not overridden when adding attributesDaniel Mensinger2019-12-051-0/+10
| |
* | lgtm: Actually supress the Non-standard exception warningDaniel Mensinger2019-12-051-6/+6
| |
* | lgtm: ignore Non-standard exception raised in special methodDaniel Mensinger2019-12-051-3/+3
| |
* | lgtm: Fix Module imported with `import` and `import from`Daniel Mensinger2019-12-051-30/+29
|/
* openbsd: execinfo is not a compiler libAntoine Jacoutot2019-11-251-2/+4
|
* Fix typos found by codespellWolfgang Stöggl2019-11-061-1/+1
| | | | - Typos were found by codespell v1.16.0
* Fix all flake8 warningsDaniel Mensinger2019-10-201-1/+1
|
* compilers: replace CompilerType with MachineInfoDylan Baker2019-10-071-44/+5
| | | | | | 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
* Merge pull request #5953 from mensinda/isystemJussi Pakkanen2019-10-061-1/+17
|\ | | | | Add is_system to dependency
| * Use -isystem instead of -idirafterDaniel Mensinger2019-10-031-1/+17
| |
* | cmake: fix detection of libraries with .so versionDaniel Mensinger2019-10-031-1/+1
|/
* Correctly handle platform-specific LDFLAGS optionsAleksey Gurtovoy2019-09-271-0/+5
|
* CUDA support on WindowsAleksey Gurtovoy2019-09-241-2/+11
|
* the solaris linker also needs start/end-group for circular linkingDylan Baker2019-09-091-2/+2
|
* mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy2019-09-051-7/+7
|
* compilers: Move the compiler argument to proxy linker flags to the compiler ↵Dylan Baker2019-08-301-0/+2
| | | | | | | | | | | | class Instead of the DynamicLinker returning a hardcoded value like `-Wl,-foo`, it now is passed a value that could be '-Wl,', or could be something '-Xlinker=' This makes a few things cleaner, and will make it possible to fix using clang (not clang-cl) on windows, where it invokes either link.exe or lld-link.exe instead of a gnu-ld compatible linker.
* compilers: Dispatch to dynamic linker classDylan Baker2019-08-141-166/+98
| | | | | Most of the cuda code is from Olexa Bilaniuk. Most of the PGI code is from Michael Hirsc