aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
AgeCommit message (Collapse)AuthorFilesLines
2019-04-27enable Windows Intel compilerMichael Hirsch, Ph.D1-5/+12
2019-04-27detect Intel ICL on windowsMichael Hirsch, Ph.D1-5/+15
ICL CPP working
2019-04-27better default order for fotran compiler searchMichael Hirsch, Ph.D1-3/+18
correct PGI windows detection doc cleanup PGI detect
2019-04-27cleanup C/CXX compiler names, adding Intel like for FortranMichael Hirsch, Ph.D1-4/+5
2019-04-27cleanup unused imports PEP8Michael Hirsch, Ph.D1-4/+2
2019-04-27order fortran compiler search order more sanely, remove unsupported compiler ↵Michael Hirsch, Ph.D1-3/+4
names
2019-04-25environment.py: Fix architecture detection on older MSVCChun-wei Fan1-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.
2019-04-24Add gcovr 4.2 supportRichard Kjerstadius1-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.
2019-04-22Add support for the Xtensa toolchainFernando Ramos1-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).
2019-04-21coredata: store cross/native files in the same form they will be used (#5224)Dylan Baker1-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
2019-04-15Note when clang objc/objc++ compiler is Windows targetedJon Turney1-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.
2019-04-12Unfold cross-compilation case from compilers_from_language()Jon Turney1-43/+21
2019-04-01detect 'arm64' as aarch64 CPU familyJanne Grunau1-0/+3
OpenBSD uses arm64 as identifier for the 64-bit ARM architecture. Refs #1578.
2019-03-26improve log for ninja detectionPaolo Bonzini1-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.
2019-03-26support a NINJA environment variablePaolo Bonzini1-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.
2019-03-26Properly detect 'bepc' as 'x86' CPU for HaikuFrançois Revol1-0/+2
2019-03-24Inline check_compilersJohn Ericson1-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.
2019-03-20mesonbuild: allow multiple --cross-file optionsRoss Burton1-2/+3
Just like --native-file, allow multiple --cross-file options. This is mostly unifying the logic between cross_files and config_files.
2019-03-19load_configs: generalise the search pathRoss Burton1-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.
2019-03-19Merge pull request #4724 from jon-turney/lib-machine-alwaysJussi Pakkanen1-1/+1
Fix linking when cross-compiling and a windows resource is first object
2019-03-11A more verbose RE Definiton in search_version. Closes #5020jrl641-2/+20
2019-03-11environment: support OpenBSD in detect_objc_compilerAntoine Jacoutot1-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)
2019-03-05Fix javac version lookup in JDK11. Closes #4322.Jussi Pakkanen1-0/+4
2019-02-27Sync up initialization logic with Properties and BinaryTableJohn Ericson1-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.
2019-02-27Move some configuration classes out of environment.pyJohn Ericson1-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.
2019-02-26Remove redundant definition of `cflags_mapping`John Ericson1-11/+0
It seems this was erroneously coppied in `54b6afa67`.
2019-02-11allow paths to be set in the cross fileDylan Baker1-0/+1
Just like the previous patch, but for cross files Fixes #1433
2019-02-11allow setting directory locations in a native fileDylan Baker1-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.
2019-02-11environment: Add class for storing directories from cross and config filesDylan Baker1-1/+41
2019-02-04Merge pull request #4626 from Ericson2314/consolidate-propertiesJussi Pakkanen1-10/+11
Go through coreutils.compiler_options.{build.host.target}
2019-02-04Merge pull request #4835 from obilaniu/cudaimprovementsJussi Pakkanen1-1/+16
CUDA support improvements
2019-02-02Never access environment.properties downstreamJohn Ericson1-10/+11
Instead use coredata.compiler_options.<machine>. This brings the cross and native code paths closer together, since both now use that. Command line options are interpreted just as before, for backwards compatibility. This does introduce some funny conditionals. In the future, I'd like to change the interpretation of command line options so - The logic is cross-agnostic, i.e. there are no conditions affected by `is_cross_build()`. - Compiler args for both the build and host machines can always be controlled by the command line. - Compiler args for both machines can always be controlled separately.
2019-01-31env: Add a repr() for MachineInfoNirbheek Chauhan1-0/+3
Makes it easier to debug with print()
2019-02-01qtdep: Look for QMAKE env var again + sprinkle debugNirbheek Chauhan1-0/+1
We used to look for the QMAKE env var in earlier versions of Meson, start looking for it again.
2019-01-31Better NVCC version detection.Olexa Bilaniuk1-1/+16
2019-01-30Overhaul pkg-config and CMake lookup, fixing the latterJohn Ericson1-0/+2
First, I noticed there was a dangling use of now-removed cross_info in the CMake lookup. No tests had caught this, but it means that CMake deps were totally broken. [It also meant that CMake could not be specified from a native file.] In a previous of mine PR which removed cross_info, I overhauled finding pkg-config a bit so that the native and cross paths were shared. I noticed that the CMake code greatly resembled the pkg-config code, so I set about fixing it to match. I then realized I could refactor things further, separating caching, finding alternatives, and validating them, while also making the validations less duplicated. So I ended up changing pkg config lookup a lot too (and CMake again, to keep matching). Overall, I think I have the proper ideom for tool lookup now, repated in two places. I think it would make sense next to share this logic between these two, compilers, static linkers, and any other tool similarly specifiable. Either the `BinaryTable` class in environment.py, or a new class for `Compiler` and friends to subclass, would be good candidates for this.
2019-01-27BUGFIX: broken/missing Fortran code/unit testsMichael Hirsch, Ph.D1-1/+1
2019-01-21All the fixes needed to make work against current master.Jussi Pakkanen1-3/+3
2019-01-21added cuda compilerBeau Johnston1-1/+43
2019-01-21Add PGI C and C++ compilers (#4803)Michael Hirsch, Ph.D1-4/+10
2019-01-16Flang Fortran compiler added.Michael Hirsch, Ph.D1-0/+4
2019-01-16mintro: Introspection interpreter refactoring (#4733)Daniel Mensinger1-1/+18
* Fixed spelling * Merged the Buildoptions and Projectinfo interpreter * Moved detect_compilers to Environment * Added removed test case * Split detect_compilers and moved even more code into Environment * Moved set_default_options to coredata * Small code simplification in mintro.run * Move cmd_line_options back to `environment` We don't actually wish to persist something this unstructured, so we shouldn't make it a field on `coredata`. It would also be data denormalization since the information we already store in coredata depends on the CLI args.
2019-01-15restore PGI compile functioningMichael Hirsch, Ph.D1-1/+1
2019-01-13OpenBSD: register machine cpu "macppc" as cpu_family "ppc"Antoine Jacoutot1-0/+2
On OpenBSD, the main PowerPC machine is known as macppc, while the processor family is powerpc: $ uname -{m,p} macppc powerpc $ echo 'import platform; print (platform.machine())' | python3 macppc $ echo 'import platform; print (platform.processor())' | python3 powerpc This allows for e.g. GLib configure to properly detect that cpu: Build machine cpu family: ppc Build machine cpu: macppc While it failed before with: WARNING: Unknown CPU family 'macppc' <snip>
2019-01-10Fix finding the static linker for native compiler in cross buildJohn Ericson1-1/+2
Native ar and cross ar are not the same!
2019-01-09Report parisc64 as parisc. Closes #4714.Jussi Pakkanen1-0/+4
2019-01-06Fixed buildoptions form sourceDaniel Mensinger1-10/+2
2019-01-06Split the monolithic introspection file into chunksDaniel Mensinger1-2/+13
2019-01-05Fix linking when cross-compiling and a windows resource is first objectJon Turney1-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.
2019-01-02Get rid of `ConfigData`John Ericson1-4/+7