summaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
Commit message (Collapse)AuthorAgeFilesLines
* coverage generator: obey the documentation and only generate supported outputsEli Schwartz2021-11-011-4/+4
| | | | | | | | | | | | | We say: > If version 4.2 or higher of the first is found, targets coverage-text, > coverage-xml, coverage-sonarqube and coverage-html are generated. But this is totally untrue. Make it true, by actually checking (and not generating broken coverage commands when older versions of gcovr are found). Fixes #9505
* Fix typos discovered by codespellChristian Clauss2021-10-101-3/+3
|
* fix extra whitespaceEli Schwartz2021-10-041-1/+0
| | | | discovered via flake8 --select E303
* pylint: check for duplicate importsDylan Baker2021-09-241-1/+0
| | | | | | I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
* environment: correctly handle cpu value aarch64_beDylan Baker2021-08-301-1/+7
| | | | Fixes #9191
* environment: add ppc -> ppc64 for aix to detect_cpuDylan Baker2021-08-301-0/+4
| | | | | This seems like an oversight, that we'd replace ppc with ppc64 on AIX for the cpu_family, but not for the specific cpu.
* environment: Add a few type annotationsDylan Baker2021-08-301-6/+4
| | | | These are just annotations in code that I'm working for this series
* environment: Add correct annotation for wrap_resolverDylan Baker2021-08-271-1/+2
|
* environment: add annotations and fix get_meson_commandDylan Baker2021-08-201-3/+7
| | | | | It is theoretically possible for the command to be None so we should handle that.
* environment: add some missing annotationsDylan Baker2021-08-201-5/+5
|
* more f-strings too complex to be caught by pyupgradeEli Schwartz2021-07-051-2/+2
|
* typing: Annotate compilers.detectDaniel Mensinger2021-06-251-1/+1
|
* Split compiler detection from EnvironmentDaniel Mensinger2021-06-251-1363/+5
| | | | | | This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
* environment: Add LLVM suffixes for 11 and 12Ting-Wei Lan2021-06-141-2/+4
| | | | | Both LLVM 11 and 12 are stable releases. Note that FreeBSD changes the way to version LLVM executables in LLVM 10.
* typing: Fully annotate run_project_tests.pyDaniel Mensinger2021-06-091-2/+2
|
* environment: Add detection logic for cythonDylan Baker2021-06-071-0/+28
|
* dependency: Add JDK system dependencyTristan Partin2021-04-121-2/+3
| | | | | The JDK system dependency is important for detecting JDK include paths that may be useful when developing a JNI interface.
* environment: simplify handling of native files with no cross filesDylan Baker2021-04-061-7/+3
| | | | | | Instead of treating native files as always being for the build machine, and then copying them to the host machine, treat them as for the build machine only when a cross file is also present
* environment: fix typos in commentDylan Baker2021-04-061-1/+1
|
* environment: don't load project options from a native file in a cross buildDylan Baker2021-04-061-1/+3
|
* environment: Add some comments to the _load_machine_file_options methodDylan Baker2021-04-061-2/+11
|
* environment: get environment variables for both host and build machinesDylan Baker2021-04-011-6/+2
| | | | Fixes #8605
* Split environment variable and command line cflagsDylan Baker2021-03-301-1/+22
| | | | | | | | They are supposed to have different behavior. The environment variables apply to both the compiler and linker when the compiler acts as a linker, but the command line ones do not. Fixes #8345
* split program related classes and functions out of dependenciesDylan Baker2021-03-191-3/+3
| | | | | | Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
* ninjabackend: Use rsp_file_syntax methodDylan Baker2021-03-141-1/+1
| | | | | This also makes us of the new enum value in the backend, for better type saftey.
* remove unused environment functionEli Schwartz2021-03-081-4/+0
| | | | | | The script dir is never really used since meson --internal handles this. The last remaining use of the raw script dir got removed in commit 522392e7553823e6b3ac38cadc4fbee72eae9540.
* mass rewrite of string formatting to use f-strings everywhereEli Schwartz2021-03-041-8/+8
| | | | performed by running "pyupgrade --py36-plus" and committing the results
* various python neatness cleanupsEli Schwartz2021-03-041-2/+2
| | | | | | | | | | | | | | | | All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
* environment: Allow setting build options in cross filesDylan Baker2021-02-181-4/+11
| | | | | | | | | | | This did work previously, so we need to let it continue working. I'm proposing removing it in 0.60 because the correct solution has always worked. I've also been a bit more defensive here, and made setting `subproject:opt = foo` in the machine files an error, as we have `[subproject:built-in options]` or `[subproject:project options]` for that.
* Environment: Fix passing envrionment variables CPPFLAGS and CFLAGSDylan Baker2021-02-171-7/+12
| | | | | | | | | | | | | | | | | | | | Or other language flags that use CPPFLAGS (like CXXFLAGS). The problem here is actually rather simple, `dict.setdefault()` doesn't work like I thought it did, I thought it created a weak entry, but it actually is equivalent to: ```python if k not in dict: dict[k] = v ``` Instead we'll use an intermediate dictionary (a default dictionary actually, since that makes things a little cleaner) and then add the keys from that dict to self.options as applicable. Test case written by Jussi, Fix by Dylan Co-authored-by: Jussi Pakkanen Fixes: #8361 Fixes: #8345
* environment: fix typosAli Alnubani2021-02-031-4/+4
| | | | | | Fixed typos and reworded some sentences. Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
* split mesonlib into a packageDylan Baker2021-01-231-2/+2
| | | | | | | | | | | | | | | | | | Currently mesonlib does some import tricks to figure out whether it needs to use windows or posix specific functions. This is a little hacky, but works fine. However, the way the typing stubs are implemented for the msvcrt and fnctl modules will cause mypy to fail on the other platform, since the functions are not implemented. To aleviate this (and for slightly cleaner design), I've split mesonlib into a pacakge with three modules. A universal module contains all of the platform agnositc code, a win32 module contains window specific code, a posix module contains the posix specific code, and a platform module contains no-op implementations. Then the package's __init__ file imports all of the universal functions and all of the functions from the approriate platform module, or the no-op versions as fallbacks. This makes mypy happy, and avoids `if`ing all over the code to switch between the platform specific code.
* make some Environment methods protectedDylan Baker2021-01-111-5/+5
| | | | | they're really not public methods, they'r only meant to be called from the initializer. Let's mark them as such.
* clean up get_env_var_pairDylan Baker2021-01-111-14/+8
| | | | | | | This function returns both the name and the value, but we never actually use the name, just the value. Also make this module private. We really want to keep all environment variable reading in the Environment class so it's done once up front. This should help with that goal.
* move get_env_var_pair to environmentDylan Baker2021-01-111-4/+30
| | | | This is only used in environment, so it should live there too.
* boost: default machine file properties to env var valuesDylan Baker2021-01-111-0/+21
| | | | | | | This both moves the env reading to configuration time, which is useful, and also simplifies the implementation of the boost dependency. The simplification comes from being able to delete basically duplicated code since the values will be in the Properties if they exist at all.
* Move BinaryTable environment lookups to EnvironmentDylan Baker2021-01-111-6/+20
| | | | | This means that all the env lookups are done once, at initial configure time. This has all of the expected advantages.
* move handling of CFLAGS and friends to environmentDylan Baker2021-01-111-30/+53
| | | | | | This has a bunch of nice features. It obviously centralizes everything, which is nice. It also means that env is only re-read at `meson --wipe`, not `meson --reconfigure`. And it's going to allow more cleanups.
* move CMAKE_PREFIX_PATH env var handling to environmentDylan Baker2021-01-111-6/+20
| | | | | | | | | | | | | | This causes the variable to be read up front and stored, rather than be re-read on each invocation of meson. This does have two slight behavioral changes. First is the obvious one that changing the variable between `meson --reconfigure` invocations has no effect. This is the way PKG_CONFIG_PATH already works. The second change is that CMAKE_PREFIX_PATH the env var is no longer appended to the values set in the machine file or on the command line, and is instead replaced by them. CMAKE_PREFIX_PATH is the only env var in meson that works this way, every other one is replaced not appended, so while this is a behavioral change, I also think its a bug fix.
* Use a single coredata dictionary for optionsDylan Baker2021-01-041-9/+10
| | | | | | | This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
* move OptionKey to mesonlibDylan Baker2021-01-041-12/+12
| | | | | There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
* use OptionKey for compiler_optionsDylan Baker2021-01-041-9/+11
|
* use the OptionKey type for command line and machine filesDylan Baker2021-01-041-43/+50
|
* Implement support of dlang -makedeps switch (#8119)Remi Thebault2020-12-291-1/+1
| | | | | | | * Implement support of dlang -makedeps switch Fix #8118 * resolve code review comments
* environment.py: Detect all mips* architectures (#8108)Persian Prince2020-12-171-3/+9
| | | | | | | | | | | | | | | | | | | | | | | * environment.py: Detect all mips* architectures We have more than those values, like: mipsel mipsel-nf mips32el mips33el-nf mipsisa32r6 mipsisa32r6el So lets just detect them all. Sorry I forgot about 64bit and closed https://github.com/mesonbuild/meson/pull/8106 But now it even detects: mipsisa64r6 mipsisa64r6el * Make dcbaker happy
* Add support for driving lld-link indirectly through clang on WindowsLaurin-Luis Lehning2020-12-131-1/+5
|
* 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
|