summaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Canonicalize 'i86pc' return from platform.machine() for SolarisAlan Coopersmith2019-06-191-2/+2
| | | | | | | i86pc may be either 32-bit or 64-bit, so use existing compiler checks to determine if it should return 'x86' or 'x86_64'. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Solaris fixesKurtis Rader2019-06-121-0/+2
| | | | Fixes #5351
* environment: better xcode 11 clang detectionDan Kegel2019-06-111-2/+2
| | | | Fixes #5474
* Purge `is_cross` and friends without changing user interfacesJohn Ericson2019-06-091-128/+100
| | | | | | | | | | | | 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.
* Use `env.machines.*` to avoid some `is_cross`John Ericson2019-06-091-10/+9
| | | | | This is a small example of the `is_cross` removal the that abstraction enables.
* backend: refactor get_custom_target_provided_librariesMarcel Hollerbach2019-06-031-0/+2
| | | | | | | | | the problem here is, that get_custom_target_provided_libraries iterated over all generated sources of a target. In each output we check if this is a library or not. In projects like EFL we have added a lot of generated target to many different targets, so the iterating of the output is rather consistent, with this commit we drop from 19% of the time spending in get_custom_target_provided_libraries down to 3.51%.
* Merge pull request #5276 from dcbaker/pkg-config-path-invalidate-cacheJussi Pakkanen2019-05-201-1/+1
|\ | | | | coredata: add pkg_config_path to depedency cache key
| * coredata: Introduce a class to act as the dependency cacheDylan Baker2019-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling the PKG_CONFIG_PATH variable in meson introduces a new problem for caching dependencies. We want to encode the pkg_config_path (or cross_pkg_config_path if we're cross compiling) to be part of the key, but we don't want to put that into the key for non-pkg-config dependencies to avoid spurious cache misses (since pkg_config_path isn't relevant to cmake, for example). However, on a cache lookup we can't know that a dependency is a pkg-config dependency until we've looked in the cache. My solution is a two layer cache, the first layer remains the same as before, the second layer is a dict-like object that encapsulates the dependency type information and uses pkg_config_path and cross_pkg_config_path as a sub key (and could be extended easily for other types). A new object type is introduced to encapsulate this so that callers don't need to be aware of the implementation details.
* | Remove compiler data from build objectJon Turney2019-05-201-2/+2
|/ | | | | The actual data is in Coredata (which is serialized) and we just held a reference in Build for (in)convenience.
* Merge pull request #5395 from dcbaker/mtest-annotationsJussi Pakkanen2019-05-161-1/+1
|\ | | | | Mtest annotations and bug fixes
| * environment: annotate detect_ninjaDylan Baker2019-05-141-1/+1
| | | | | | | | for mtest
* | Make `PerMachine` and `MachineChoice` have just `build` and `host`John Ericson2019-05-161-27/+39
|/ | | | | | | | | | | | | | | | | | Meson itself *almost* only cares about the build and host platforms. The exception is it takes a `target_machine` in the cross file and exposes it to the user; but it doesn't do anything else with it. It's therefore overkill to put target in `PerMachine` and `MachineChoice`. Instead, we make a `PerThreeMachine` only for the machine infos. Additionally fix a few other things that were bugging me in the process: - Get rid of `MachineInfos` class. Since `envconfig.py` was created, it has no methods that couldn't just got on `PerMachine` - Make `default_missing` and `miss_defaulting` work functionally. That means we can just locally bind rather than bind as class vars the "unfrozen" configuration. This helps prevent bugs where one forgets to freeze a configuration.
* environment: search for icl and ifort before cl and goftranDylan Baker2019-05-131-3/+8
| | | | | | | Intel helpfully provides a cl.exe that is indistinguishable from Microsoft's cl.exe in output, but has the same behavior as icl.exe. Since icl and ifort will only be present in your path if you've started an Intel command prompt search for that first.
* environment: Add search for ICLDylan Baker2019-05-131-0/+17
|
* linkers: Add linker class for intel's xilibDylan Baker2019-05-131-2/+7
|
* compilers: Split C-Like functionality into a mixin classesDylan Baker2019-05-031-1/+1
| | | | | | | | | | | | | | | | | Currently C++ inherits C, which can lead to diamond problems. By pulling the code out into a standalone mixin class that the C, C++, ObjC, and Objc++ compilers can inherit and override as necessary we remove one source of diamonding. I've chosen to split this out into it's own file as the CLikeCompiler class is over 1000 lines by itself. This also breaks the VisualStudio derived classes inheriting from each other, to avoid the same C -> CPP inheritance problems. This is all one giant patch because there just isn't a clean way to separate this. I've done the same for Fortran since it effectively inherits the CCompiler (I say effectively because was it actually did was gross beyond explanation), it's probably not correct, but it seems to work for now. There really is a lot of layering violation going on in the Compilers, and a really good scrubbing would do this code a lot of good.
* environment: Fix syntax errorDylan Baker2019-05-021-2/+3
|
* Revert "detect Intel ICL on windows"Dylan Baker2019-05-021-15/+4
| | | | This reverts commit 3a75bb5259abbcae820b47f5f4633c564411893b.
* Revert "enable Windows Intel compiler"Dylan Baker2019-05-021-12/+5
| | | | This reverts commit 50f23815658bb704f454c83edfe2cc7e4e419628.
* Add some type annotations and fix lintsJohn Ericson2019-05-021-6/+9
| | | | | | Some things, like `method[...](...)` or `x: ... = ...` python 3.5 doesn't support, so I made a comment instead with the intention that it can someday be made into a real annotation.
* enable Windows Intel compilerMichael Hirsch, Ph.D2019-04-271-5/+12
|
* detect Intel ICL on windowsMichael Hirsch, Ph.D2019-04-271-5/+15
| | | | ICL CPP working
* better default order for fotran compiler searchMichael Hirsch, Ph.D2019-04-271-3/+18
| | | | | | | | correct PGI windows detection doc cleanup PGI detect
* cleanup C/CXX compiler names, adding Intel like for FortranMichael Hirsch, Ph.D2019-04-271-4/+5
|
* cleanup unused imports PEP8Michael Hirsch, Ph.D2019-04-271-4/+2
|
* order fortran compiler search order more sanely, remove unsupported compiler ↵Michael Hirsch, Ph.D2019-04-271-3/+4
| | | | names
* environment.py: Fix architecture detection on older MSVCChun-wei Fan2019-04-251-1/+1
| | | | | | The cl.exe from Visual Studio 2010 and earlier report '80x86', not 'x86', for the architecture that the compiler supports. So, we ought to check for that as well to see whether we are building for 32-bit x86.
* Add gcovr 4.2 supportRichard Kjerstadius2019-04-241-3/+3
| | | | | | | | | | | | The out-of-source build syntax for gcovr 4.2 is different compared to previous versions and therefore an update was needed. In researching the most appropriate solution it was found that any gcovr version older than 3.3 always resulted in 0% coverage. Because of this, rather than adding an additional layer of logic, some already existing logic was modified to ensure correct syntax for the new version, while versions older than 3.3 are flagged as not supported. Closes mesonbuild#5089.
* Add support for the Xtensa toolchainFernando Ramos2019-04-221-1/+1
| | | | | | | | | From (almost) all points of view, the Xtensa toolchain can be treated as a regular GCC toolchain. This patch adds very basic support so that, at least, meson does not fail when trying to use "xt-xcc" (which makes it possible to use it without problems).
* coredata: store cross/native files in the same form they will be used (#5224)Dylan Baker2019-04-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * coredata: store cross/native files in the same form they will be used Currently they're forced to absolute paths when they're stored in the coredata datastructure, then when they're loaded we de-absolute path them to check if they're in the system wide directories. This doesn't work at all, since the ninja backend will generat a dependency on a file that is in the source directory unless the path was already given as absolute. This results in builds being retriggereed forever due to a non-existant file. The right way to do this is to figure out whether the file is in the build directory, is absolute, or is in one of the system paths at creation time, and store that path as absolute. Then the code that reads the file and the code that generates the dependencies in the ninja backend just takes the computed list and there is no mismatch between them. Fixes #5257 * run_unittests: Add a test for correct native file storage This tests the bug in #5257
* Note when clang objc/objc++ compiler is Windows targetedJon Turney2019-04-151-0/+4
| | | | | | | | | When using clang as an objc/objc++ compiler, identify if it's a Windows targeted compiler, so that GnuLikeCompiler::get_pic_args() doesn't use '-fPIC', which clang considers an error for the Window target. Future work: Factor out parsing the clang target string from the detectors for various languages.
* Unfold cross-compilation case from compilers_from_language()Jon Turney2019-04-121-43/+21
|
* detect 'arm64' as aarch64 CPU familyJanne Grunau2019-04-011-0/+3
| | | | | OpenBSD uses arm64 as identifier for the 64-bit ARM architecture. Refs #1578.
* improve log for ninja detectionPaolo Bonzini2019-03-261-1/+8
| | | | | | Print "Found samurai-x.y" when samu is found instead of ninja, and do not print "Found ninja-1.8-1.8" when NINJA points to /usr/bin/ninja-1.8.
* support a NINJA environment variablePaolo Bonzini2019-03-261-2/+4
| | | | | | | | This can be useful to test a local ninja version (for example while developing changes to ninja or samurai) without modifying the PATH. The ninja binary that is detected is then hardcoded in the build.ninja rules for scan-build and clean, so that it is always used until reconfiguration.
* Properly detect 'bepc' as 'x86' CPU for HaikuFrançois Revol2019-03-261-0/+2
|
* Inline check_compilersJohn Ericson2019-03-241-8/+0
| | | | | | | | | | This function is used just once. It also seems all policy and no mechanism (it raises, it calls the same function to do all the work twice in a simple way). This makes it seem to be as a good candidate for inlining. `environment` and `coredata` are woefully intertwined and while this change doesn't fix that, but at least it makes it easier to follow.
* mesonbuild: allow multiple --cross-file optionsRoss Burton2019-03-201-2/+3
| | | | | Just like --native-file, allow multiple --cross-file options. This is mostly unifying the logic between cross_files and config_files.
* load_configs: generalise the search pathRoss Burton2019-03-191-1/+1
| | | | | | Instead of hard-coding the fact that load_configs() searches for files under meson/native, pass in the subdirectory allowing the cross-file code to use the same logic.
* Merge pull request #4724 from jon-turney/lib-machine-alwaysJussi Pakkanen2019-03-191-1/+1
|\ | | | | Fix linking when cross-compiling and a windows resource is first object
| * Fix linking when cross-compiling and a windows resource is first objectJon Turney2019-01-051-1/+1
| | | | | | | | | | | | | | | | It appears that LIB/LINK default to the host architecture if they can't guess it from the first object. With the MSVC toolchain, resource files are (usually) compiled to an arch-neutral .res format. Always explicitly provide a '/MACHINE:' argument to avoid it guessing incorrectly when cross-compiling.
* | A more verbose RE Definiton in search_version. Closes #5020jrl642019-03-111-2/+20
| |
* | environment: support OpenBSD in detect_objc_compilerAntoine Jacoutot2019-03-111-2/+2
| | | | | | | | | | | | We need to match the "clang --version" output on OpenBSD: $ clang --version | head -1 OpenBSD clang version 7.0.1 (tags/RELEASE_701/final) (based on LLVM 7.0.1)
* | Fix javac version lookup in JDK11. Closes #4322.Jussi Pakkanen2019-03-051-0/+4
| |
* | Sync up initialization logic with Properties and BinaryTableJohn Ericson2019-02-271-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | 1. They (and the others) all use PerMachineDefaultable. It's not the best class, but consistency come first. (It and all of them can be improved accross the board later.) 2. They use `None` as the default argument so as not to mutate what's effectively a global variables. (Thanks @dcbaker!) 3. They have a `fallback` field to centralize authority on when environment variables should be consulted.
* | Move some configuration classes out of environment.pyJohn Ericson2019-02-271-401/+41
| | | | | | | | | | | | | | | | | | | | | | First of all, I'd like compilers and other modules that environment.py currently imports to be able to take these without creating hard-to-follow module cycles. Second of all, environment.py's exact purpose seems a bit obscured. Splitting the data types (and basic pure functions) from the more complex logic that infers that data seems like a good way to separate concerns.
* | Remove redundant definition of `cflags_mapping`John Ericson2019-02-261-11/+0
| | | | | | | | It seems this was erroneously coppied in `54b6afa67`.
* | allow paths to be set in the cross fileDylan Baker2019-02-111-0/+1
| | | | | | | | | | | | Just like the previous patch, but for cross files Fixes #1433
* | allow setting directory locations in a native fileDylan Baker2019-02-111-11/+19
| | | | | | | | | | | | This allows the person running configure (either a developer, user, or distro maintainer) to keep a configuration of where various kinds of files should end up.
* | environment: Add class for storing directories from cross and config filesDylan Baker2019-02-111-1/+41
| |