aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
AgeCommit message (Collapse)AuthorFilesLines
2020-09-04environment: use ExternalProgram to find ninjaPaolo Bonzini1-6/+10
This allows the NINJA environment variable to support all the Windows special cases, especially allowing an absolute path without extension. Based on a patch by Yonggang Luo. Fixes: #7659 Suggested-by: Nirbheek Chauhan <nirbheek@centricular.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-02environment: do not raise exception in detect_cuda_compilerMatt Madison1-2/+0
when the compiler is not a string. When the compiler is set in the build configuration (required, for example, in a cross-build setup), the compiler setting is already a list, which is the desired type. Signed-off-by: Matt Madison <matt@madison.systems>
2020-08-30Be stricter when detecting Windows/CygwinChristoph Reiter1-3/+2
This removes the check for "mingw" for platform.system(). The only case I know where "mingw" is return is if using a msys Python under a msys2 mingw environment. This combination is not really supported by meson and will result in weird errors, so remove the check. The second change is checking sys.platform for cygwin instead of platform.system(). The former is document to return "cygwin", while the latter is not and just returns uname(). While under Cygwin it uname() always starts with "cygwin" it's not hardcoded in MSYS2 and starts with the environment name. Using sys.platform is safer here. Fixes #7552
2020-08-25Merge pull request #7581 from peterh/aixJussi Pakkanen1-4/+17
Add AIX support
2020-08-23Merge pull request #7600 from alexrp/masterJussi Pakkanen1-1/+2
Add C2x option support.
2020-08-22Merge pull request #7609 from dcbaker/submit/2020-08/cmake-fix-apple-clangJussi Pakkanen1-2/+7
Fix mapping of apple compilers in cmake
2020-08-22compilers: Add Apple subclasses for ObjC and ObjC++Dylan Baker1-2/+7
These are needed because in some cases we need to be able to know if we're using vanilla clang or Apple's clang.
2020-08-22Update LLVM tool versions for LLVM/Clang 10.Alex RĂžnne Petersen1-1/+2
2020-08-22Merge pull request #7447 from scivision/nvcJussi Pakkanen1-3/+24
Add support for NVidia HPC SDK compilers
2020-08-12aix: allow both 32-bit and 64-bit objects in a static libraryPeter Harris1-2/+2
Without the -Xany flag, the ar command will complain when an .o file is compiled for the non-default bit width. This change is necessary to allow 64-bit builds via a native (or cross) file.
2020-08-12aix: detect and support the AIX dynamic linkerPeter Harris1-0/+9
2020-08-12aix: fix cpu family detectionPeter Harris1-2/+6
Like the BSDs, AIX does not return anything useful in platform.machine().
2020-08-08Use uname -p to detect x86_64 on QNX.Elad Lahav1-1/+1
2020-08-04"Downgrade" warning when regenerating after version bumpZbigniew Jędrzejewski-Szmek1-0/+5
There is nothing to "warn" about, this is a completely routine occurence. OTOH, when something is corrupted, we should warn. Keep the red color and "WARNING:" prefix in that case. Example output: $ ninja -C build Regenerating configuration from scratch: Build directory has been generated with Meson version 0.55.999, which is incompatible with current version 0.56.0. The Meson build system Version: 0.56.0 ...
2020-08-04Capitalize some constants in coredataJohn Ericson1-2/+2
I've been getting confused between them and similarly-named other things, so I figured it was high time to clean this up.
2020-08-02Make meson recognize the Qualcomm LLVM toolchainAntony Chan1-2/+6
Meson calls `path/to/clang++ --version` to guess which build toolchain the user has picked to build the source code. For the Qualcomm LLVM toolchain, the output have an unusual output as shown below: ``` clang version 8.0.12 Snapdragon LLVM ARM Compiler 8.0.12 (based on llvm.org 7.0+) Target: arm-unknown-linux-gnueabi Thread model: posix Repository: (ssh://git-hexagon-aus.qualcomm.com:...) InstalledDir: /pkg/qct/software/llvm/release/arm/8.0.12/bin ``` Another unusual pattern is the output of `path/to/ld.qcld --version`: ``` ARM Linker from Snapdragon LLVM ARM Compiler Version 8.0.12 ARM Linker based on LLVM version: 8.0 ``` The Meson logic is modified accordingly so that Meson can correctly determine toolchain as "LLVM aarch64 cross-compiler on GNU/Linux64 OS". This is the expected output of `meson --native-file native_file.ini --cross-file cross_file.ini build/aarch64-debug/`: ``` ... C++ compiler for the host machine: ... (clang 8.0.12 "clang version 8.0.12") C++ linker for the host machine: ... ld.lld 8.0.12 ... ```
2020-08-01Put machine file and cmd line parsing in EnvironmentDylan Baker1-8/+122
This creates a full set of option in environment that mirror those in coredata, this mirroring of the coredata structure is convenient because lookups int env (such as when initializing compilers) becomes a straight dict lookup, with no list iteration. It also means that all of the command line and machine files are read and stored in the correct order before they're ever accessed, simplifying the logic of using them.
2020-08-01machine-files: deprecate the paths sectionDylan Baker1-19/+7
2020-08-01Allow setting built-in options from cross/native filesDylan Baker1-5/+23
This is like the project options, but for meson builtin options. The only real differences here have to do with the differences between meson builtin options and project options. Some meson options can be set on a per-machine basis (build.pkg_config_path vs pkg_config_path) others can be set on a per-subproject basis, but should inherit the parent setting.
2020-07-30Allow setting project options from cross or native filesDylan Baker1-0/+19
This allows adding a `[project options]` section to a cross or native file that contains the options defined for a project in it's meson_option.txt file.
2020-07-30Support armel/armhf builds on native arm64 hosts.Mark Hindley1-1/+2
2020-07-13add Nvidia HPC SDK compilersMichael Hirsch, Ph.D1-3/+24
2020-07-07SolarisDynamicLinker: report ld's version instead of gcc'sAlan Coopersmith1-1/+7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-04find_program: Do not use fallback when before parsing project()Xavier Claessens1-0/+1
Mesa is doing `project(... find_program() ...)` so environment.wrap_resolver is not defined yet.
2020-07-02environment: Correctly detect arm64 as aarch64Marvin Scholz1-0/+2
On some systems aarch64 is reported as arm64. Due to mesons mangling of everything that starts with arm, it would end up being detected as arm (which implies 32 bit) which is incorrect.
2020-06-29envconfig: Add [constants] section in machine filesXavier Claessens1-5/+3
Machine files already supports `+` operator as an implementation detail, since it's using eval(). Now make it an officially supported feature and add a way to define constants that are used while evaluating an entry value.
2020-06-17coverage: llvm-cov supportCary Converse1-1/+10
2020-06-15environment: fallback regex for versions like 2020.01Michael Hirsch1-2/+8
add four-digit version unit_test cases
2020-06-10Updated to resolve issue identifying SGI CPUs on IRIX systemsEric Dodd1-0/+3
2020-05-22compilers: add fetching of define list for clangYevhenii Kolesnikov1-1/+25
Simmilar to gcc, the list of pre-processor defines can be fetched with `-dM -E` option. The way cpu_family is determined on linux relies on this list. Fixes incorrect value of cpu_family on linux, when crosscompiling: ``` CC="clang -m32" meson ./build ``` Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com> Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-05-13Fix outdated cross-compilation checksOle André Vadla RavnÄs1-10/+10
2020-05-10Improve Emscripten linker version detectionAndrei Alexeyev1-6/+9
2020-04-21switch python2 %s for python3 .formatMichael1-4/+4
2020-04-20Compiler options per langJohn Ericson1-2/+2
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`.
2020-03-29environment: "power machintosh" is ppcDylan Baker1-4/+2
I've combined the two ppc checks into one, since they're not very complicated and added power machintosh, which is used by PPC macs running older versions of osx. Fixes: #6746
2020-03-24Clarify a workaround for older versions of LLD for MinGW (#6836) [skip ci]Martin Storsjö1-1/+3
The previous diagnosis (that the wrapper that injects the -target option to clang caused the issues) doesn't seem right; the issue was that LLD's MinGW frontend (which is invoked when ld.lld is given a COFF argument to the -m option) didn't handle the --version argument before LLD 9.0.0.
2020-03-23Fix legacy env var support with crossJohn Ericson1-17/+18
Fix #3969
2020-03-21-Add xc16 and c2000 C,Cpp toolchain supportalanNz1-1/+35
2020-03-19Fix bogus parameter passed to LLVMDynamicLinker (llvm-mingw regression)Andrei Alexeyev1-1/+1
2020-03-12Merge pull request #6356 from dcbaker/fix-d-compiler-abstractionsJussi Pakkanen1-36/+54
Fix d compiler abstractions
2020-03-10Improve regular expression for MSVC compiler target arch detectionLuca Bacci1-1/+1
Did not work for some MSVC output language combinations. Now should work for every locale / output language. Fixes issue #6757
2020-03-09linkers: Allow optlink to be invoked indirectlyDylan Baker1-1/+1
2020-03-09Allow invoking the linker directly through dmdDylan Baker1-11/+21
DMD is awful in a lot of ways. To change the linker you set an environment variable, which is pretty much impossible for us.
2020-03-09Allow invoking link.exe and lld-link.exe through ldc2Dylan Baker1-24/+32
Like it wants
2020-03-08Merge pull request #6688 from dcbaker/emcc-linker-bugsJussi Pakkanen1-1/+11
Emcc linker bugs and improvments
2020-02-29environment: Strip 'el' from the end of mips architecturesDylan Baker1-0/+6
Mips architectures may have `el` on the end, to differentiate the little endian from the big endian variants. We don't encode endianness in the cpu names, so ensure we've stripped that. Fixes #6655
2020-02-28environment: Fix construction of CudaLinkerJan Alexander Steffens (heftig)1-1/+1
The 0.53.2 test suite has a new failure: Traceback (most recent call last): File "run_project_tests.py", line 1024, in <module> detect_system_compiler() File "run_project_tests.py", line 964, in detect_system_compiler comp = env.compiler_from_language(lang, MachineChoice.HOST) File "/build/meson/src/meson-0.53.2/mesonbuild/environment.py", line 1565, in compiler_from_language comp = self.detect_cuda_compiler(for_machine) File "/build/meson/src/meson-0.53.2/mesonbuild/environment.py", line 1131, in detect_cuda_compiler linker = CudaLinker(compiler, for_machine, 'nvlink', CudaCompiler.LINKER_PREFIX, [], version=CudaLinker.parse_version()) File "/build/meson/src/meson-0.53.2/mesonbuild/linkers.py", line 963, in __init__ super().__init__('nvlink', *args, **kwargs) TypeError: __init__() takes 6 positional arguments but 7 positional arguments (and 1 keyword-only argument) were given Fixes: c708c52ca225 ("linkers: Update the linker names to be more consistent")
2020-02-27compilers/linkers: Add a representation for wasm-ldDylan Baker1-1/+11
Emscripten does have a stand alone linker, wasm-ld. This patch adds the linker, adds detection for the linker, and removes the IsLinkerMixin for emscripten. This is a little more correct, and makes the code a lot cleaner and more robust.
2020-02-23Merge pull request #6637 from ↔Jussi Pakkanen1-2/+2
mesonbuild/nirbheek/implement-symbolextractor-windows Implement symbolextractor on windows + some cleanups/fixes
2020-02-22ninjabackend: List PDBs in output list for targetsNirbheek Chauhan1-2/+2
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.