summaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
Commit message (Collapse)AuthorAgeFilesLines
* Bump Ninja requirement to 1.8.Jussi Pakkanen2020-11-261-2/+2
|
* environment: Fix detection of rust compilers, moreDylan Baker2020-11-131-11/+27
|
* compilers/rust: warn about setting -C linker in your compiler argsDylan Baker2020-11-131-0/+7
|
* compilers/rust: add and use an implementation of use_linker_argsDylan Baker2020-11-131-7/+7
|
* environment: Properly pass linker to rustcDylan Baker2020-11-131-7/+9
| | | | | | | rustc is very different than other compilers, in that it doesn't generate object files, it just creates a final target out of the intermediate sources. As such, it needs to know about the linker args in the compiler invocation.
* environment: Fix detection of swift linkerDylan Baker2020-10-301-2/+2
| | | | Apparently in some cases swift prints to stderr instead of stdout
* fix typo "machintosh" -> "macintosh"Ken Cunningham2020-10-191-1/+1
| | | | | fixes machine detection for power macintosh systems
* Machine file pkg_config_path overrides environmentXavier Claessens2020-10-161-5/+5
| | | | | | | | | This is consistent with c_args in machine file overriding CFLAGS from env. This also spotted an issue where in a native build this resulted in pkg_config_path being /bar instead of /foo: `-Dpkg_config_path=/foo -Dbuild.pkg_config_path=/bar` Fixes: #7573
* Refactor handling of machine file optionsXavier Claessens2020-10-161-139/+68
| | | | | | It is much easier to not try to parse options into complicated structures until we actually collected all options: machine files, command line, project()'s default_options, environment.
* cmake: Add cross compilation supportDaniel Mensinger2020-10-131-3/+10
|
* environment: provide a more detailed explanation of linker detection failuresDylan Baker2020-10-061-2/+8
| | | | | | | | Just saying "it failed" is accurate, but not useful to helping someone figure out why it failed. Giving them the stdout and stderr (like we might with compilers) should help people resolve the issue. Fixes: #7173
* compilers/fortran: make ifort on windows signature match ICL'sDylan Baker2020-10-011-2/+2
|
* compilers/cpp: Add type annotationsDylan Baker2020-10-011-6/+6
|
* compilers: fully type annotate the C compilersDylan Baker2020-10-011-2/+2
|
* environment: Pass defines to clang based ObjC[++] compilersDylan Baker2020-09-241-1/+5
| | | | | | mypy noticed that we were passing [] (instead of a dict or None) to the ClangCompiler class in objc, which made me noticed that for C and C++ we set the defines, but not for ObjC and ObjC++
* compilers: make is_cross part of the base Compiler classDylan Baker2020-09-241-1/+2
| | | | | | | 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.
* Add support for the CompCert C CompilerSebastian Meyer2020-09-151-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add preliminary support for the CompCert C Compiler The intention is to use this with the picolibc, so some GCC flags are automatically filtered. Since CompCert uses GCC is for linking, those GCC-linker flags which are used by picolibc, are automatically prefixed with '-WUl', so that they're passed to GCC. Squashed commit of the following: commit 4e0ad66dca9de301d2e41e74aea4142afbd1da7d Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 14:20:39 2020 +0200 remove '-fall' from default arguments, also filter -ftls-model=.* commit 41afa3ccc62ae72824eb319cb8b34b7e6693cb67 Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 14:13:55 2020 +0200 use regex for filtering ccomp args commit d68d242d0ad22f8bf53923ce849da9b86b696a75 Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 13:54:36 2020 +0200 filter some gcc arguments commit 982a01756266bddbbd211c54e8dbfa2f43dec38f Author: Sebastian Meyer <meyer@absint.com> Date: Fri Aug 28 15:03:14 2020 +0200 fix ccomp meson configuration commit dce0bea00b1caa094b1ed0c6c77cf6c12f0f58d9 Author: Sebastian Meyer <meyer@absint.com> Date: Thu Aug 27 13:02:19 2020 +0200 add CompCert to meson (does not fully work, yet) * remove unused import and s/cls/self/ fixes the two obvious LGTM warnings * CompCert: Do not ignore unsupported GCC flags Some are safe to ignore, however, as per https://github.com/mesonbuild/meson/pull/7674, they should not be ignored by meson itself. Instead the meson.build should take care to select only those which are actually supported by the compiler. * remove unused variable * Only add arguments once. * Apply suggestions from code review Co-authored-by: Dylan Baker <dylan@pnwbakers.com> * Remove erroneous ' ' from '-o {}'.format() As noticed by @dcbaker * added release note snippet for compcert * properly split parameters As suggested by @dcbaker, these parameters should be properly split into multiple strings. Co-authored-by: Dylan Baker <dylan@pnwbakers.com> * Update add_compcert_compiler.md Added a sentence about the state of the implementation (experimental); use proper markdown * properly separate arguments Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
* Improve regexp for MSVC target arch detection againTamás Bálint Misius2020-09-131-1/+1
|
* Store first line of VisualStudio compiler output as full_versionJon Turney2020-09-111-1/+1
| | | | | Store the first line of VisualStudio compiler output as full_version, so it gets output when we report compiler details.
* typing: get rid of most T.castDaniel Mensinger2020-09-081-4/+3
|
* typing: more fixesDaniel Mensinger2020-09-081-11/+14
|
* environment: use ExternalProgram to find ninjaPaolo Bonzini2020-09-041-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>
* environment: do not raise exception in detect_cuda_compilerMatt Madison2020-09-021-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>
* Be stricter when detecting Windows/CygwinChristoph Reiter2020-08-301-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
* Merge pull request #7581 from peterh/aixJussi Pakkanen2020-08-251-4/+17
|\ | | | | Add AIX support
| * aix: allow both 32-bit and 64-bit objects in a static libraryPeter Harris2020-08-121-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.
| * aix: detect and support the AIX dynamic linkerPeter Harris2020-08-121-0/+9
| |
| * aix: fix cpu family detectionPeter Harris2020-08-121-2/+6
| | | | | | | | Like the BSDs, AIX does not return anything useful in platform.machine().
* | Merge pull request #7600 from alexrp/masterJussi Pakkanen2020-08-231-1/+2
|\ \ | | | | | | Add C2x option support.
| * | Update LLVM tool versions for LLVM/Clang 10.Alex Rønne Petersen2020-08-221-1/+2
| |/
* | Merge pull request #7609 from dcbaker/submit/2020-08/cmake-fix-apple-clangJussi Pakkanen2020-08-221-2/+7
|\ \ | | | | | | Fix mapping of apple compilers in cmake
| * | compilers: Add Apple subclasses for ObjC and ObjC++Dylan Baker2020-08-221-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.
* | Merge pull request #7447 from scivision/nvcJussi Pakkanen2020-08-221-3/+24
|\ \ | |/ |/| Add support for NVidia HPC SDK compilers
| * add Nvidia HPC SDK compilersMichael Hirsch, Ph.D2020-07-131-3/+24
| |
* | Use uname -p to detect x86_64 on QNX.Elad Lahav2020-08-081-1/+1
| |
* | "Downgrade" warning when regenerating after version bumpZbigniew Jędrzejewski-Szmek2020-08-041-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 ...
* | Capitalize some constants in coredataJohn Ericson2020-08-041-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.
* | Make meson recognize the Qualcomm LLVM toolchainAntony Chan2020-08-021-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 ... ```
* | Put machine file and cmd line parsing in EnvironmentDylan Baker2020-08-011-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.
* | machine-files: deprecate the paths sectionDylan Baker2020-08-011-19/+7
| |
* | Allow setting built-in options from cross/native filesDylan Baker2020-08-011-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.
* | Allow setting project options from cross or native filesDylan Baker2020-07-301-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.
* | Support armel/armhf builds on native arm64 hosts.Mark Hindley2020-07-301-1/+2
| |
* | SolarisDynamicLinker: report ld's version instead of gcc'sAlan Coopersmith2020-07-071-1/+7
|/ | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* find_program: Do not use fallback when before parsing project()Xavier Claessens2020-07-041-0/+1
| | | | | Mesa is doing `project(... find_program() ...)` so environment.wrap_resolver is not defined yet.
* environment: Correctly detect arm64 as aarch64Marvin Scholz2020-07-021-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.
* envconfig: Add [constants] section in machine filesXavier Claessens2020-06-291-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.
* coverage: llvm-cov supportCary Converse2020-06-171-1/+10
|
* environment: fallback regex for versions like 2020.01Michael Hirsch2020-06-151-2/+8
| | | | add four-digit version unit_test cases
* Updated to resolve issue identifying SGI CPUs on IRIX systemsEric Dodd2020-06-101-0/+3
|